Convert struct with several fields into long table

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?

 채택된 답변

Ameer Hamza
Ameer Hamza 2020년 11월 3일
Try this
T = array2table(cell2mat(squeeze(struct2cell(trai)).'), 'VariableNames', fieldnames(trai))

댓글 수: 2

worked perfectly, thank you!
I am glad to be of help!

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Data Type Conversion에 대해 자세히 알아보기

질문:

2020년 11월 3일

댓글:

2020년 11월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by