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

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

... a datafile which does not exist.
parent 6b4aad50
Branches
No related tags found
No related merge requests found
......@@ -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)
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment