Importing data from excel sheet

1 Ansicht (letzte 30 Tage)
Abhijit Bahirat
Abhijit Bahirat am 18 Sep. 2012
I want to import all the data from excel worksheets.
I tried using following command, >> Ans = xlsread(FILEPATH);
After executing this line, the data only from first sheet is getting uploaded.
Is there any other way to upload entire data using single command?

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 18 Sep. 2012
Bearbeitet: Azzi Abdelmalek am 18 Sep. 2012
sheet={'sheet1','sheet2'}, %specify your sheets
out=cellfun(@(x) xlsread('book1.xlsx',x),sheet,'uni',false)
if you want one line command (for 4 sheets)
out=cellfun(@(x) xlsread('book1.xlsx',x),cellfun(@(y) ...
sprintf('sheet%d',y),num2cell(1:4),'uni',false),'uni',false)
  1 Kommentar
Abhijit Bahirat
Abhijit Bahirat am 20 Sep. 2012
Thank you Mr.Azzi!
I shall reply back for further queries.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Data Import from MATLAB finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by