How to convert xls to mat file ?
Show older comments
I want to convert xls file to mat file
4 Comments
Kan-Hua
on 4 Mar 2014
To convert a xls file to a mat file, you need to decide the data structure. What Matlab data structure do you want to use for storing your xls file? numerical array? cell array? or table?
Surendar Kumar Kodali
on 18 Dec 2019
need the table structure .
Walter Roberson
on 18 Dec 2019
Use readtable() to get a table structure.
Answers (3)
ES
on 4 Mar 2014
%get the values in the Excel using xlsread.
[num,txt,raw] = xlsread(filename,sheet,xlRange);
%combine data as you want:
AllData={txt;num};%as you want
%save in mat file
save(matfileName,'AllData');%In your matfile name
3 Comments
deep
on 13 Mar 2015
This helped me :)
Andreas Goser
on 16 Mar 2015
Then vote it up :-)
Tuffahatul Ummah
on 21 Sep 2016
AllData={txt;num};%as you want what txt and num mean? i don't have clue for what must I fill it
Andreas Goser
on 4 Mar 2014
0 votes
As of the complexity of what can be in an XLS file, the way to go is to import with XLSREAD, probably postprocess and then write the MAT file with SAVE.
1 Comment
aman slamaa
on 20 Apr 2017
how write Andreas? please type your steps
sagar
on 4 Mar 2014
0 votes
Categories
Find more on Workspace Variables and MAT Files 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!