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!