reading a special sheet of an EXCEL file with knowing the row numbers of that

does anyone know how matlab can read a special sheet of an excel file with knowing only row numbers of that sheet? for example one excel file have 4 sheets and one of that sheets has more than 500 rows( we don't know how many rows there are exactly) and only 2 columns exactly. now its needed matlab to read this sheet.

 Accepted Answer

use [Num,Txt,Raw]=xlsread(ExcelFile,SheetName)
then size(Raw) will tell you how many rows and columns of data are in that sheet.

5 Comments

thanks
i don't know SheetName
is there a way to know sheetNames of a .xls?
You said the Excel file has 4 sheets. Each must have a name, which is the string in the tab at the bottom if the Excel window. You can also use number (1,2,3 or 4) to specify the sheet. You could also use xlsfinfo() to get the sheet name.
this name is variable and when matlab reads these .xls, its needed read that special sheet( rows>500). in some this name is 'a' and in some othars 'b' or 'c' or anything else
Then use [Num,Txt,Raw]=xlsread(ExcelFile,4), assuming it is always the 4th sheet.
perfect that's right. its always the 3th sheet

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!