Filter löschen
Filter löschen

How to loop string files in the IBWread function.

1 Ansicht (letzte 30 Tage)
navan
navan am 26 Jun. 2015
Kommentiert: navan am 27 Jun. 2015
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.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 26 Jun. 2015
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 Kommentar
navan
navan am 27 Jun. 2015
Dear Roberson,
Thanks alot for your help. It worked well. Thanks again

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Characters and Strings finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by