financial time series obiect: get a column by name string?

4 ビュー (過去 30 日間)
Andy
Andy 2017 年 3 月 17 日
編集済み: Andy 2017 年 3 月 17 日
Say, I have a fts object of type:
dt =
desc: (none)
freq: Daily (1)
'dates: (2715)' 'times: (2715)' 'A: (2715)' 'B: (2715)' 'C: (2715)'
to access a column, you'd do something like:
dt.A
What if you'd want to place this in a function and pass the column name as a string argument:
col_name = 'A'
Is there a way to access this column from dt having its name in a string?

採用された回答

dpb
dpb 2017 年 3 月 17 日
Again, similarly to the other question, relate it to the struct; I didn't find the similar documentation under the financial TS link, but here is link for structures; should work the same way...
  1 件のコメント
Andy
Andy 2017 年 3 月 17 日
編集済み: Andy 2017 年 3 月 17 日
it works indeed:
dt.Close
cl = 'Close'
dt.(cl)
produce similar results. Thanks!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by