xlsread not able to reference my sheet names.

16 ビュー (過去 30 日間)
Chameleon17 2016 年 1 月 6 日
コメント済み: Image Analyst 2016 年 1 月 7 日
Good afternoon,
I've never had this problem before, I'm certain it must be a pretty easy fix.
I'm trying to open an excel file, using xlsread. I have my program on a loop though specifying that each pass it should use a sheet of a different name. It keeps telling me though that the sheet name does not exist, but when I use xlsinfo it tells me that the sheet name is there.
DATA = xlsread('DATA1', 12)
I'm just a bit stumped as to how to get around this.
Any advice would be very much appreciated!
  2 件のコメント
Renato Agurto
Renato Agurto 2016 年 1 月 6 日
I that the actual command you are using? where are you writing the filename? You also have to write the sheet name OR the number, not both


回答 (2 件)

Image Analyst
Image Analyst 2016 年 1 月 6 日
Are you sure you have 12 worksheets in the workbook? Have you tried using the name of the sheet instead of it's number? Can you attach the data.xlsx workbook file to your posting with the paperclip icon?
  4 件のコメント
Image Analyst
Image Analyst 2016 年 1 月 7 日
Are you sure it's twelve and not (capital i)2?


Renato Agurto
Renato Agurto 2016 年 1 月 6 日
編集済み: Renato Agurto 2016 年 1 月 6 日
The name of the sheet should be a string. You should use then:
DATA = xlsread('DATA1.xlsx', '12')
If you use a number it will select the sheet number 12 (if you have 12 sheets or more of course)
  3 件のコメント
Walter Roberson
Walter Roberson 2016 年 1 月 6 日
After you run the above, please also post
sheets{1}, (sheets{1}+0)
so we can check for unexpected characters in the name.


Community Treasure Hunt

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

Start Hunting!

Translated by