access structure fields without loop
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
hi guys,
Assume structure A has a field called "name".
I want to get the first 100 elements of "name".
Can i do it without loop?
Thanks in advanced.
0 Commenti
Risposte (2)
Paulo Silva
il 16 Ago 2011
Catch each name into a cell
B={A(1:100).name};
If can get any name into a string like this
B{1}
0 Commenti
Walter Roberson
il 16 Ago 2011
Paulo's answer might well be what is required, but the question is ambiguous. Another possible interpretation would be
A.name(1:100)
0 Commenti
Vedere anche
Categorie
Scopri di più su Structures in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!