Call merge method, added unitary tests.

time-shift
Stéphane Adjemian (Charybdis) 2013-03-08 17:44:53 +01:00
parent cefbf45a9c
commit 1c29970c6d
1 changed files with 46 additions and 0 deletions

View File

@ -45,6 +45,10 @@ if isa(A,'dynSeries') && isa(B,'dynSeries')
return
end
end
return
elseif length(S)==1 && isequal(S.type,'.')
A = merge(A,B);
return
end
end
@ -114,3 +118,45 @@ error('dynSeries::subsasgn: Wrong calling sequence!')
%$ t(6) = dyn_assert(ts1.data,[log(A(:,1)), A(:,2), log(A(:,3))],1e-15);
%$ T = all(t);
%@eof:3
%@test:4
%$ % Define a datasets.
%$ A = rand(10,3); B = rand(10,3);
%$
%$ % Instantiate two dynSeries object.
%$ ts1 = dynSeries(A,[],{'A1';'A2';'A3'},[]);
%$ ts2 = dynSeries(B,[],{'B1';'B2';'B3'},[]);
%$
%$ % Apply the logarithm function to the first and third variables.
%$ ts1.A1 = ts2.B1;
%$
%$ % Instantiate a time series object.
%$
%$ t(1) = dyn_assert(ts1.vobs,4);
%$ t(2) = dyn_assert(ts1.nobs,10);
%$ t(3) = dyn_assert(ts1.name{1},'A1');
%$ t(3) = dyn_assert(ts1.name{4},'B1');
%$ T = all(t);
%@eof:4
%@test:5
%$ % Define a datasets.
%$ A = rand(10,3); B = rand(10,3);
%$
%$ % Instantiate two dynSeries object.
%$ ts1 = dynSeries(A,[],{'A1';'A2';'A3'},[]);
%$ ts2 = dynSeries(B,[],{'A1';'B2';'B3'},[]);
%$
%$ % Apply the logarithm function to the first and third variables.
%$ ts1.A1 = ts2.A1;
%$
%$ % Instantiate a time series object.
%$
%$ t(1) = dyn_assert(ts1.vobs,3);
%$ t(2) = dyn_assert(ts1.nobs,10);
%$ t(3) = dyn_assert(ts1.name{1},'A1');
%$ t(4) = dyn_assert(ts1.data(:,1),B(:,1), 1e-15);
%$ t(5) = dyn_assert(ts1.data(:,2:3),A(:,2:3), 1e-15);
%$ T = all(t);
%@eof:5