필터 지우기
필터 지우기

How to read Excel file with changing the range automatically

조회 수: 1 (최근 30일)
Manimaran Kanesan
Manimaran Kanesan 2013년 5월 14일
HI All,
I am having problem to change the excel range automatically, and need to do it manually everytime
example
columnD = xlsread(filename,'D1:D1000');
The D1:D1000, I need to change it manually. Is there a way to change it automatically. Well I have tried few things below, but does not work
D(x):D(y) - does not work
D%d:D%d - does not work
D{x}:D{y} - does not work
Please help to show me how to control this.
Thank you Manimara

답변 (1개)

Yao Li
Yao Li 2013년 5월 14일
i=1;
j=1000;
range_array=strcat('D',num2str(i),':D',num2str(j));
  댓글 수: 2
Jan
Jan 2013년 5월 14일
Perhaps this is nicer:
range_array = sprintf('%d:%d', i, j)
Yao Li
Yao Li 2013년 5월 14일
yes, it's much better. Thanks, Jan. But maybe D is missing
range_array = sprintf('D%d:D%d', i, j)

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by