Added a trap when trying to populate a dseries object with...

... a datafile which does not exist.
parent 6b4aad50
......@@ -200,7 +200,11 @@ switch S(1).type
if ischar(S(1).subs{1}) && ~isdate(S(1).subs{1})
% If ts is an empty dseries object, populate this object by reading data in a file.
if isempty(A)
B = dseries(S(1).subs{1});
if exist(S(1).subs{1}, 'file')
B = dseries(S(1).subs{1});
else
error('dseries::subsref: Cannot find file %s', S(1).subs{1})
end
else
error('dseries::subsref: dseries object is not empty!')
end
......
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