Azzera filtri
Azzera filtri

Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

for loop become to while loop

2 visualizzazioni (ultimi 30 giorni)
Pan
Pan il 6 Ago 2012
Chiuso: MATLAB Answer Bot il 20 Ago 2021
this is my code , but it's for loop, I want to become to "while loop"
How to do?
pleas teach me , thank you!
for im=idxip(a):idxip(a+1)
subplot(1,1,1);
imshow(uint8(xi(:,:,:,im)));
title('video','Fontsize',22);
%pause(1);
drawnow;
end

Risposte (2)

Ilham Hardy
Ilham Hardy il 6 Ago 2012
doc while

Azzi Abdelmalek
Azzi Abdelmalek il 6 Ago 2012
Modificato: Azzi Abdelmalek il 6 Ago 2012
im=idxip(a)
while im<=idxip(a+1)
%----your code----------------
subplot(1,1,1);
imshow(uint8(xi(:,:,:,im)));
title('video','Fontsize',22);
%pause(1);
drawnow;
%------------------------------
im=im+1
end
% while the condition is checked, the program will redo the loop

Questa domanda è chiusa.

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by