access structure fields without loop

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.

Antworten (2)

Paulo Silva
Paulo Silva am 16 Aug. 2011

0 Stimmen

Catch each name into a cell
B={A(1:100).name};
If can get any name into a string like this
B{1}
Walter Roberson
Walter Roberson am 16 Aug. 2011

0 Stimmen

Paulo's answer might well be what is required, but the question is ambiguous. Another possible interpretation would be
A.name(1:100)

Kategorien

Tags

Gefragt:

am 16 Aug. 2011

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by