How to loop string files in the IBWread function.

조회 수: 1 (최근 30일)
navan
navan 2015년 6월 26일
댓글: navan 2015년 6월 27일
I am using IBWread function to convert igor file to matlap workspace. I would like to know how can i loop the script from 1 to 5 for ii and 2to 6 for jj. I use the following code.
for ii=1:5
forjj=2:6
Data = IBWread('%d.ibw',ii);% i want IBWread('1.ibw')
Data1 = IBWread('%d.ibw',jj);
end
end
I want to run IBWread('1.ibw') in my first iteration to IBWread('5.ibw') to my last iteration. But my code shows error. Kindly help.

채택된 답변

Walter Roberson
Walter Roberson 2015년 6월 26일
for ii=1:5
for jj=2:6
Data = IBWread(sprintf('%d.ibw',ii));% i want IBWread('1.ibw')
Data1 = IBWread(sprintf('%d.ibw',jj));
end
end
  댓글 수: 1
navan
navan 2015년 6월 27일
Dear Roberson,
Thanks alot for your help. It worked well. Thanks again

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by