From 025b1d2e4edc6944d085d0cf3d15bf26711f5cec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org> Date: Wed, 12 Dec 2018 18:37:28 +0100 Subject: [PATCH] Remove workarounds for Octave All dseries syntaxes now work under Octave, except ts{'variable'}(range) = value. --- src/@dseries/subsasgn.m | 59 +++++++---------------------------------- 1 file changed, 10 insertions(+), 49 deletions(-) diff --git a/src/@dseries/subsasgn.m b/src/@dseries/subsasgn.m index aee652d..e66505b 100644 --- a/src/@dseries/subsasgn.m +++ b/src/@dseries/subsasgn.m @@ -244,11 +244,7 @@ end %$ %$ % modify first object. %$ try -%$ if isoctave() -%$ ts1.A2 = ts2; -%$ else -%$ ts1{'A2'} = ts2; -%$ end +%$ ts1{'A2'} = ts2; %$ t(1) = 1; %$ catch %$ t(1) = 0; @@ -275,11 +271,7 @@ end %$ %$ try %$ % Apply the exponential function to the second variable. -%$ if isoctave() -%$ ts1.A2 = ts1{'A2'}.exp; -%$ else -%$ ts1{'A2'} = ts1{'A2'}.exp; -%$ end +%$ ts1{'A2'} = ts1{'A2'}.exp; %$ t(1) = 1; %$ catch %$ t(1) = 0; @@ -305,13 +297,8 @@ end %$ %$ try %$ % Apply the logarithm function to the first and third variables. -%$ if isoctave() -%$ ts1.A1 = ts1{'A1'}.log; -%$ ts1.A3 = ts1{'A3'}.log; -%$ else -%$ ts1{'A1'} = ts1{'A1'}.log; -%$ ts1{'A3'} = ts1{'A3'}.log; -%$ end +%$ ts1{'A1'} = ts1{'A1'}.log; +%$ ts1{'A3'} = ts1{'A3'}.log; %$ t(1) = 1; %$ catch %$ t(1) = 0; @@ -337,12 +324,7 @@ end %$ %$ try %$ % Apply the logarithm function to the first and third variables of ts1. -%$ if isoctave() -%$ ts1.A1 = ts1{'A1'}.log; -%$ ts1.A3 = ts1{'A3'}.log; -%$ else -%$ ts1{'A1','A3'} = ts1{'A1','A3'}.log; -%$ end +%$ ts1{'A1','A3'} = ts1{'A1','A3'}.log; %$ t(1) = 1; %$ catch %$ t(1) = 0; @@ -420,11 +402,7 @@ end %$ %$ try %$ % Append B2 to the first object. -%$ if isoctave() -%$ ts1.B2 = ts2{'B2'}; -%$ else -%$ ts1{'B2'} = ts2{'B2'}; -%$ end +%$ ts1{'B2'} = ts2{'B2'}; %$ t(1) = 1; %$ catch %$ t(1) = 0; @@ -452,11 +430,7 @@ end %$ %$ % modify first object. %$ try -%$ if isoctave() -%$ ts1.A4 = ts2; -%$ else -%$ ts1{'A4'} = ts2; -%$ end +%$ ts1{'A4'} = ts2; %$ t(1) = 1; %$ catch %$ t(1) = 0; @@ -484,12 +458,7 @@ end %$ %$ % modify first object. %$ try -%$ if isoctave() -%$ ts1.A1 = ts2.A1; -%$ ts1.A4 = ts2.B1; -%$ else -%$ ts1{'A1','A4'} = ts2; -%$ end +%$ ts1{'A1','A4'} = ts2; %$ t(1) = 1; %$ catch %$ t(1) = 0; @@ -576,11 +545,7 @@ end %$ d1 = dates('1950Q3'); %$ d2 = dates('1951Q3'); %$ rg = d1:d2; -%$ if isoctave() -%$ ts1.A1(rg) = ts2{'B1'}(rg); -%$ else -%$ ts1{'A1'}(rg) = ts2{'B1'}(rg); -%$ end +%$ ts1{'A1'}(rg) = ts2{'B1'}(rg); %$ t(1) = 1; %$ catch %$ t(1) = 0; @@ -610,11 +575,7 @@ end %$ d1 = dates('1950Q3'); %$ d2 = dates('1951Q3'); %$ rg = d1:d2; -%$ if isoctave() -%$ ts1.A1(rg) = B(3:7); -%$ else -%$ ts1{'A1'}(rg) = B(3:7); -%$ end +%$ ts1.A1(rg) = B(3:7); %$ t(1) = 1; %$ catch %$ t(1) = 0; -- GitLab