필터 지우기
필터 지우기

Could we add variable in folder directory ??

조회 수: 1 (최근 30일)
Ocean Blue
Ocean Blue 2012년 3월 13일
I want to access several sequenced folders
Example :
[ndata, text, alldata] = xlsread('D:\folder\1\file');
[ndata, text, alldata] = xlsread('D:\folder\2\file');
[ndata, text, alldata] = xlsread('D:\folder\3\file');
[ndata, text, alldata] = xlsread('D:\folder\4\file');
Could I replace 1,2,3and 4 by variable i .. How could the directory be written here ?!!

채택된 답변

Jason Ross
Jason Ross 2012년 3월 13일
  댓글 수: 1
Jan
Jan 2012년 3월 13일
Or explicitely:
for k = 1:4; xlsread(['D:\folder\', sprintf('%d', k). '\file']); end

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by