How to dynamically create a struct?
Afficher commentaires plus anciens
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
Réponse acceptée
Plus de réponses (1)
Walter Roberson
le 1 Fév 2017
TheStructure = cell2struct( cell(1, length(NamesCell)), NamesCell, 2 )
Catégories
En savoir plus sur Structures dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!