Using a variable range with xlsread??
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello, I am trying to use xlsread, but I need the range to be variables. for example:
str1 = 'A1'; str2 = 'B5'; Input = xlsread(filename,'str1:str2');
However, this is giving me the following error: "Data range is invalid." Is there a way to do this? Thanks!
-Matt
댓글 수: 0
답변 (1개)
Jan
2011년 6월 13일
'str1:str2' is the string 'str1:str2' - not surprising. But you want to concatenate two (three!) string variables:
str1 = 'A1';
str2 = 'B5';
Input = xlsread(filename,[str1, ':', str2]);
Such methods are explained in the Getting Started chapters of the documentation.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Tables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!