How to combine the name of struct together

2 ビュー (過去 30 日間)
Sharah
Sharah 2016 年 11 月 16 日
回答済み: Alexandra Harkai 2016 年 11 月 16 日
I am trying to add data into few struct with different name, say if
k = 'TD',
put data into
Data.TD(i).somethingelse
and if
k = 'AB',
put some data into
Data.AB(i).somethingelse
can anyone enlighten me?

採用された回答

Alexandra Harkai
Alexandra Harkai 2016 年 11 月 16 日
Data.(k)(i).somethingelse = your_value
See the Documentation for reference.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStructures についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by