Importing data from excel sheet

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?

 채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2012년 9월 18일
편집: Azzi Abdelmalek 2012년 9월 18일

0 개 추천

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

Abhijit Bahirat
Abhijit Bahirat 2012년 9월 20일
Thank you Mr.Azzi!
I shall reply back for further queries.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

제품

태그

Community Treasure Hunt

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

Start Hunting!

Translated by