Changed @dynDates/subsref so that the selection of a single element in a dynDates object returns a dynDates object with one element (not a dynDate object).
parent
153fe1ca82
commit
049ba8d527
|
@ -73,13 +73,7 @@ switch S(1).type
|
||||||
error('dynDates::subsref: Unknown public member or method!')
|
error('dynDates::subsref: Unknown public member or method!')
|
||||||
end
|
end
|
||||||
case '()'
|
case '()'
|
||||||
if isscalar(S(1).subs{1})
|
% Extract some dates.
|
||||||
if isint(S(1).subs{1}) && S(1).subs{1}>0 && S(1).subs{1}<=A.ndat
|
|
||||||
B = dynDate(A.time(S(1).subs{1},:),A.freq);
|
|
||||||
else
|
|
||||||
error(['dynDates::subsref: the index has to be a positive integer less than or equal to ' int2str(A.ndat) '!'])
|
|
||||||
end
|
|
||||||
else
|
|
||||||
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 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 = dynDates();
|
B = dynDates();
|
||||||
B.freq = A.freq;
|
B.freq = A.freq;
|
||||||
|
@ -88,7 +82,6 @@ switch S(1).type
|
||||||
else
|
else
|
||||||
error(['dynDates::subsref: indices has to be a vector of positive integers less than or equal to ' int2str(A.ndat) '!'])
|
error(['dynDates::subsref: indices has to be a vector of positive integers less than or equal to ' int2str(A.ndat) '!'])
|
||||||
end
|
end
|
||||||
end
|
|
||||||
otherwise
|
otherwise
|
||||||
error('dynDates::subsref: Something is wrong in your syntax!')
|
error('dynDates::subsref: Something is wrong in your syntax!')
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue