Combining rows of each field within a structure
이전 댓글 표시
Hello,
I'd like to combined the rows of a structure for each field. I won't always know how many rows there will be in the structure. The example I show is a 1 x 3 structure, but I'd like to plan for a 1 x ? structure. So I thought combining the rows in a for loop would be the best way. I'm aiming for a 3 x 101 double in each of the fields in this example.
I'm sure there's a pretty easy solution to this but I'm a novice when it comes to MATLAB

Any help would be greatly appreciated!
댓글 수: 2
Image Analyst
2022년 11월 30일
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
채택된 답변
추가 답변 (2개)
s(1).f=1:3;
s(2).f=4:6;
s(3).f=7:9
vertcat(s.f)
How about this:
s = load('Combined_Structure.mat');
m = s.ModOutRstance_interp_x_all;
allm = vertcat(m.LHipAngles)
카테고리
도움말 센터 및 File Exchange에서 Structures에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!