dynamic naming of structures
Afficher commentaires plus anciens
If I have a variable x='name', how can I use x to build a structure with name 'name' that looks like:
name.a
name.b
No need to tell me about the hazards of dynamic variable naming.
Thanks.
Réponse acceptée
Plus de réponses (2)
James Tursa
le 16 Mai 2022
Would it be acceptable to use x as a dynamic fieldname instead of the top level variable name? E.g.,
v.(x).a
v.(x).b
DrK
le 17 Mai 2022
0 votes
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!