How to convert xls to mat file ?

I want to convert xls file to mat file

4 comentarios

Kan-Hua
Kan-Hua el 4 de Mzo. de 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 el 20 de Jul. de 2016
Editada: s k el 20 de Jul. de 2016
yes numerical array
Surendar Kumar Kodali
Surendar Kumar Kodali el 18 de Dic. de 2019
need the table structure .
Walter Roberson
Walter Roberson el 18 de Dic. de 2019
Use readtable() to get a table structure.

Iniciar sesión para comentar.

Respuestas (3)

ES
ES el 4 de Mzo. de 2014

37 votos

%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 comentarios

deep
deep el 13 de Mzo. de 2015
This helped me :)
Andreas Goser
Andreas Goser el 16 de Mzo. de 2015
Then vote it up :-)
Tuffahatul Ummah
Tuffahatul Ummah el 21 de Sept. de 2016
AllData={txt;num};%as you want what txt and num mean? i don't have clue for what must I fill it

Iniciar sesión para comentar.

Andreas Goser
Andreas Goser el 4 de Mzo. de 2014

0 votos

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 el 4 de Mzo. de 2014

0 votos

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

Categorías

Etiquetas

Preguntada:

el 4 de Mzo. de 2014

Comentada:

el 18 de Dic. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by