Exporting workspace variables in excel sheet

20 vues (au cours des 30 derniers jours)
Koustubh Shirke
Koustubh Shirke le 16 Oct 2020
Commenté : Stephen23 le 16 Oct 2020
Hi,
I have 200 variables in my matlab workspace. how can I export this data into the excel sheet as it is in matlab ?
Variable names should be the headers in the excel sheet.
Thanks in advance !

Réponses (1)

Ameer Hamza
Ameer Hamza le 16 Oct 2020
As Stephen mentioned, creating variable names dynamically is not a good coding practice. A better approach will be to create a table(), and column names can be the same as variable names. Then you can simply use writetable() and it will print variable name as the header row of the Excel sheet.
  1 commentaire
Stephen23
Stephen23 le 16 Oct 2020
"...creating variable names dynamically is not a good coding practice."
Also accessing them dynamically, as in this question.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Data Import from MATLAB dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by