Convert struct with several fields into long table
조회 수: 15 (최근 30일)
이전 댓글 표시
I have a structure (see image) with 9 fields and 100 rows. Each row is a 200x1 double. As each row has exactly the same dimensions, I was wondering if there was a function I could use to open up the rows to make a long table with 20000 rows?

댓글 수: 0
채택된 답변
Ameer Hamza
2020년 11월 3일
Try this
T = array2table(cell2mat(squeeze(struct2cell(trai)).'), 'VariableNames', fieldnames(trai))
댓글 수: 2
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!