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

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
Branches
No related tags found
No related merge requests found
......@@ -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},:);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment