Effacer les filtres
Effacer les filtres

Looping Structrures with a Name

1 vue (au cours des 30 derniers jours)
Amanda
Amanda le 9 Mai 2013
I'm trying to loop over a structure. I have a Structure A with field names: State, Tornado, and Hurricane. So what I currently have is the following:
for n=1:numel(A)
name(n) = S(n).Tornado
name(n) = S(n).Hurricane
end
What I'm trying to achieve is a NAME: name(1),name(2),name(3) of each data set, so I can acess all the data sets after the loop has completed.
Thanks,
Amanda

Réponses (1)

Azzi Abdelmalek
Azzi Abdelmalek le 9 Mai 2013
name1={S.Tornadoname}
name2={S.Hurricane}

Catégories

En savoir plus sur Loops and Conditional Statements 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!

Translated by