How to change range while importing Excel data into MATLAB using xlsread?
조회 수: 5 (최근 30일)
이전 댓글 표시
MathWorks Support Team
2018년 8월 21일
답변: MathWorks Support Team
2018년 8월 21일
Hi,
I have to import an excel file, wherein columns and rows can change - how do I specify it in MATLAB Code
YTWstart= xlsread('YTW.xlsx','YTW1','b6:x9') ;
like the last part of the code could be b2 to X25 or b2 to AB21
Please let me know, how can I solve it.
채택된 답변
MathWorks Support Team
2018년 8월 21일
It is certainly possible to specify range as a variable.
Refer the example below-
beginning = 'A1';
ending = 'B2';
range = [beginning, ':', ending];
[num,txt,raw] = xlsread('myExample.xlsx', range);
You can change the variables '_beginning_' and '_ending_' to change the range.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!