How to convert xls to mat file ?

I want to convert xls file to mat file

4 Commenti

Kan-Hua
Kan-Hua il 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?
s k
s k il 20 Lug 2016
Modificato: s k il 20 Lug 2016
yes numerical array
need the table structure .
Use readtable() to get a table structure.

Accedi per commentare.

Risposte (3)

ES
ES il 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 Commenti

deep
deep il 13 Mar 2015
This helped me :)
Then vote it up :-)
AllData={txt;num};%as you want what txt and num mean? i don't have clue for what must I fill it

Accedi per commentare.

Andreas Goser
Andreas Goser il 4 Mar 2014

0 voti

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.
sagar
sagar il 4 Mar 2014

0 voti

I have already xls file with 6 column and it contain numeric and string data. So I want to convert into mat file..

Richiesto:

il 4 Mar 2014

Commentato:

il 18 Dic 2019

Community Treasure Hunt

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

Start Hunting!

Translated by