How to dynamically create a struct?
古いコメントを表示
I want to create a struct with the number of fields decided based on some user input. What's a good way of doing this? Or should I be using a cell or matrix instead?
Thanks
採用された回答
その他の回答 (1 件)
Walter Roberson
2017 年 2 月 1 日
TheStructure = cell2struct( cell(1, length(NamesCell)), NamesCell, 2 )
カテゴリ
ヘルプ センター および File Exchange で Structures についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!