Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Converting a .mat file to .xls

Asked by John on 24 Feb 2012

Hi there,

Is there anyway to convert a .mat file to an excel file in matlab?

Thank you





No products are associated with this question.

2 Answers

Answer by Kaustubha Govind on 24 Feb 2012

You need to write MATLAB code to do this. First load the contents of the MAT-file into the workspace using the load command. You can then get the names of the variables in the workspace by using something like:

   varNames = who;

Be careful to not get variables that you may have created before the MAT-file was loaded.

You can then loop through the cell-array and write each variable to an Excel file using xlswrite.


Kaustubha Govind
Answer by Sean de Wolski on 24 Feb 2012
doc importdata
doc xlswrite

Some friends for your journey...


Sean de Wolski

Contact us