I want to know how to create a struct type mat file
2 次查看(过去 30 天)
显示 更早的评论
how to create a struct type mat file with different fields .for example in this way .can anyone please help me create a mat file in this way ,thank you in advance.
1 个评论
Bob Thompson
2021-5-4
I'm not sure I understand what you mean by a 'struct type mat file'. A mat file stores matlab workspace entities, which can include structure variables. Is that an acceptable solution?
回答(1 个)
Walter Roberson
2021-5-4
result = cell2struct({currency.feature}, {currency.name}, 2);
The result would be a struct with fields named 'Dollar', 'pound', 'rupee', 'yen', with value according to the feature value.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!