I want to know how to create a struct type mat file
2 views (last 30 days)
Show older comments
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 Comment
Bob Thompson
on 4 May 2021
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?
Answers (1)
Walter Roberson
on 4 May 2021
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.
See Also
Categories
Find more on Structures in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!