Export data from MATLAB table to new table in Excel
40 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Rachael Courts
el 25 de Mayo de 2020
Comentada: rubindan
el 15 de Jun. de 2020
See image below for reference.
I have created a 5763 x 15 table named 'data' which you can see in my workspace. I am wanting to export all information (including headers) from this table into xlsx.
I thought I'd try code on just 3 columns to see if I could get it working. For all the coding I have tried I receive 'T' as just 3 header columns without any information within the rows.
In the image you will see a few of the many attempts I have tried. Any help would be welcomed!
0 comentarios
Respuesta aceptada
rubindan
el 25 de Mayo de 2020
In your case T is a cell array of three strings. The correct form to use would be
id = some_vector_of_numbers;
UTS = anouther_vector;
startSeconds = yet_another_vector;
T = table(id,UTS,startSeconds);
writetable(T,'data.xlsx')
Matlab will use the column names id,UTS, and startSeconds for the header.
2 comentarios
rubindan
el 15 de Jun. de 2020
I was thinking that id, startSeconds, and UTS are columns in your table, but now I see that your table has 15 columns. In thaty case I do not undesrant what they are.
To save the table as it is just type writetable(data,'data.xlsx')
Más respuestas (0)
Ver también
Categorías
Más información sobre Spreadsheets en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!