필터 지우기
필터 지우기

combine values from struct.

조회 수: 3 (최근 30일)
FV
FV 2020년 5월 5일
댓글: Stephen23 2020년 5월 6일
I have a struct of 1x30 and every struct have a large double every one different but same number of columns.
I want the values from all the doubles to form one matrix. How can I do that?
  댓글 수: 2
FV
FV 2020년 5월 5일
Something faster than this.
A=[B(1).SmallerB;B(2).SmallerB;B(3).SmallerB;B(4).SmallerB;B(5).SmallerB;.........];

댓글을 달려면 로그인하십시오.

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 5월 5일
편집: Ameer Hamza 2020년 5월 5일
See vertcat(). Run this example
s1(1).a = [1 2 3];
s1(2).a = [4 5 6; 7 8 9];
s1(3).a = [1 2 3; 4 5 6; 7 8 9];
vertcat(s1.a)
Result
ans =
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

태그

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by