xlsread selection of the lines
1 回表示 (過去 30 日間)
古いコメントを表示
hello everybody. i was wondering if it’s possible to use in the xlsread in matlab to indicate the initial value to export till and that the matlab itself recognize where to end. for better explain myself i have a table that another program creates from measures in the time. and the table begins in the A11:B5010 (for example) and what i am using right now is this command:
data = xlsread(files(i).name,'A11:B5010')
but sometimes the experience takes more time than the measures i have so for example the table would finish at B6000. that’s why i would like to make something like
data = xlsread(files(i).name,'A11:Bend')
is there any possibility to make this in a way that the program itself adapts to the length of the table? so i can treat different measures at the same time that has different time periods?
0 件のコメント
採用された回答
dpb
2016 年 10 月 18 日
Just read the sheet. xlsread will return the numeric data in an array of the size it is. If there's data prior to the initial row that's not wanted, then just eliminate it in memory.
2 件のコメント
dpb
2016 年 10 月 18 日
It actually takes measurably longer to read a full sheet than the subset? That surprises me immensely. What's the range of actual data and content?
xlsread only understands range expressions that are two opposing corners and doesn't have any dynamic features such as the end function that refers to the last element in an in-memory array, say.
It can use a named range if you can define that in the spreadsheet to encompass the area of interest. To use that syntax you must also specify the sheet name explicitly. See documentation for details.
I'm sure there's probably a function within Excel via ActiveX server to ascertain the location of last element but that's getting into what is an Excel facility question, not Matlab; see the Excel help files for how one would do that (I don't know Excel more than rudimentary and every time I've looked at the functional programming in same it's been so overwhelming in its volume and difficulty in finding what one's looking for I've always just given it up instead. I know there are those who are whizzes; just not me, sorry).
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Spreadsheets についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!