Importing data from excel sheet

1 回表示 (過去 30 日間)
Abhijit Bahirat
Abhijit Bahirat 2012 年 9 月 18 日
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 日
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 件)

カテゴリ

Help Center および File ExchangeData Import from MATLAB についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by