Fixed bugs in pop method.

Avoid crash if p is empty or p has more than one element.
parent 26074ce2
......@@ -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,:);
......
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