Changed behaviour of subsref.

If o is a dates object then o([]) returns an empty dates object with the
same frequency than o.
parent 1da1e979
......@@ -152,7 +152,9 @@ switch S(1).type
end
else
% dates object A is not empty. We extract some dates
if isvector(S(1).subs{1}) && all(isint(S(1).subs{1})) && all(S(1).subs{1}>0) && all(S(1).subs{1}<=A.ndat())
if ismatrix(S(1).subs{1}) && isempty(S(1).subs{1})
B = dates(A.freq);
elseif isvector(S(1).subs{1}) && all(isint(S(1).subs{1})) && all(S(1).subs{1}>0) && all(S(1).subs{1}<=A.ndat())
B = dates();
B.freq = A.freq;
B.time = A.time(S(1).subs{1},:);
......
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