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
......@@ -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!')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment