Skip to content
Snippets Groups Projects
Commit 1bb5a3a4 authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Fixed bug.

Allow following syntax:

>> qq = dates('Q'); a = qq(1990,1); b = qq(1990,2);

by making a deep copy of subsref's first input argument.
parent 972392d9
Branches
No related tags found
No related merge requests found
......@@ -117,7 +117,7 @@ switch S(1).type
else
% Populate an empty dates object with time member (freq is already specified).
% Needs one (time) or two (first and second columns of time for years and subperiods) inputs.
B = A;
B = copy(A);
if isequal(length(S(1).subs),2)
if ~iscolumn(S(1).subs{1}) && ~all(isint(S(1).subs{1}))
error('dates::subsref: First argument has to be a column vector of integers!')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment