Could we add variable in folder directory ??
조회 수: 1 (최근 30일)
이전 댓글 표시
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 ?!!
댓글 수: 0
채택된 답변
Jason Ross
2012년 3월 13일
Use something like this:
댓글 수: 1
Jan
2012년 3월 13일
Or explicitely:
for k = 1:4; xlsread(['D:\folder\', sprintf('%d', k). '\file']); end
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!