Convert struct with several fields into long table
15 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Aleya Marzuki
am 3 Nov. 2020
Kommentiert: Ameer Hamza
am 3 Nov. 2020
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 Kommentare
Akzeptierte Antwort
Ameer Hamza
am 3 Nov. 2020
Try this
T = array2table(cell2mat(squeeze(struct2cell(trai)).'), 'VariableNames', fieldnames(trai))
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!