Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

how can I access lower level structure arrays without a loop?

조회 수: 3 (최근 30일)
John
John 2013년 5월 21일
마감: MATLAB Answer Bot 2021년 8월 20일
I have a structure defined (S) that is 1xM structure, where S.geo.xy = Nx2 matrix
so disp(S(1).geo.xy) returns
0.4150 -0.1935
0.4150 0.1935
0.5850 0.1935
0.5850 -0.1935
I want to take all M in the S structure and concatenate the values to one vector without using a for loop. I can easily do this with a for loop. But I was looking for a more efficient way. For example in the structure I have another field that is S(1).anyfield
ans =
6.1700 0
and I can pull all these values into one vector by typing [temp.anyfield] and reshaping for a matrix. But [temp.geo.xy] doesn't work the same. Any thoughts?
Thanks for the help, John
  댓글 수: 2
Azzi Abdelmalek
Azzi Abdelmalek 2013년 5월 21일
Do you want to concatenate s.geo.xy with s.anyfield?
John
John 2013년 5월 21일
No, I was just using s.anyfield as an example of how I can concatenate s.anyfield without a loop but it doesn't work the same for s.geo.xy

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by