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

Fixed bugs in pop method.

Avoid crash if p is empty or p has more than one element.
parent 26074ce2
Branches
No related tags found
No related merge requests found
......@@ -51,6 +51,12 @@ else
if ~isequal(o.freq,p.freq)
error('dates:pop','Inputs must have common frequency!')
end
if p.length()>1
error('dates:pop','dates to be removed must have one element!')
end
if isempty(p)
return
end
idx = find(o==p);
jdx = find(transpose(1:o.ndat)~=idx(end));
o.time = o.time(jdx,:);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment