access structure fields without loop
1 回表示 (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (2 件)
Paulo Silva
2011 年 8 月 16 日
Catch each name into a cell
B={A(1:100).name};
If can get any name into a string like this
B{1}
0 件のコメント
Walter Roberson
2011 年 8 月 16 日
Paulo's answer might well be what is required, but the question is ambiguous. Another possible interpretation would be
A.name(1:100)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Structures についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!