How to convert a file from .mat to .csv

1 view (last 30 days)
Giulia Zanetti
Giulia Zanetti on 30 Apr 2015
Commented: Walter Roberson on 10 May 2015
I have to convert a data table from .mat to .csv but I don't know how to do that.

Answers (2)

Image Analyst
Image Analyst on 30 Apr 2015
Try something like this
storedStructure = load(matFileName); % Read in data from the mat file.
dataTable = storedStructure.dataTable; % Whatever you called it when you saved it.
csvwrite(csvfile, dataTable); % Save to disk in csv format.

Giulia Zanetti
Giulia Zanetti on 10 May 2015
Thank you very much! Sorry but I have another problem. When I write this: storedStructure = load(matFileName); Matlab answers with this: Error using load Argument must contain a string.
What can I do? Thank you again.

Categories

Find more on Data Type Conversion in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!