transfer Matlab Workspace to Excel
9 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello
i wanted to know how to transfer the data i have in my workspace to Excel automatically after running my code, my data are only numbers.
For example if this is my Workspace:![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1491552/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1491552/image.png)
i want this to be the excel Table:![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1491557/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1491557/image.png)
how can i do this ?
Thank you.
0 commentaires
Réponse acceptée
dpb
le 24 Sep 2023
Déplacé(e) : dpb
le 24 Sep 2023
Easiest would be to use arrays instead of a zillion sequentially named individual variables; associate a string array of names with them if desired (for the example, it could be simply an expression such as
nColumns=size(yourNewArrayReplacingVariables,2);
tT=array2table(yourNewArrayReplacingVariables,'VariableNames',cellstr(char('a'+[0:N-1].')));
writetable('yourExcelFile.xlsx',tT,'WriteVariableNames',1)
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Spreadsheets dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!