access structure fields without loop
조회 수: 2 (최근 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!