how can I test for the existence of a financial time series object?
14 ビュー (過去 30 日間)
古いコメントを表示
This seems like it would be really easy, but I can't figure it out.
Basically, i want to see if time series A exists, and if it does, I want to make C=merge(A,B). If A doesn't exist, then I just want C=B.
Thanks for any help.
Best, Mike
0 件のコメント
回答 (2 件)
dpb
2014 年 7 月 23 日
doc exist
if exist('A')
C=merge(A,B);
else
C=B
end
I don't have Finan Toolbox so can't test; I presume exist will return 8 as a class if it does exist. Of course, any nonzero value means there is an A of some sort extant as the logic above is written it doesn't care which type of object it may be.
0 件のコメント
Sean de Wolski
2014 年 7 月 23 日
isa and exist will be your friends.
if exist('A','var') && isa(A,'timeseries')
C = merge(A,B)
else
C = B;
end
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Data Type Identification についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!