access data in a nested struct
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello,
I have a struct with several levels. For example:
s.L1.L2.L3
what would be the most efficient way to look for a string in Level L3?
Thanks!
0 commentaires
Réponse acceptée
SC
le 30 Juin 2020
Modifié(e) : SC
le 30 Juin 2020
Let us name your string field inside L3 as 'Name'.
If you want to access data inside a nested struct,
You can do it by, s.L1.L2.L3.Name = 'String'
For more information on accessing nested structs refer to the following: https://www.mathworks.com/help/matlab/matlab_prog/access-data-in-nested-structures.html
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Structures dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!