Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

for loop become to while loop

조회 수: 1 (최근 30일)
Pan
Pan 2012년 8월 6일
마감: MATLAB Answer Bot 2021년 8월 20일
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

답변 (2개)

Ilham Hardy
Ilham Hardy 2012년 8월 6일
doc while

Azzi Abdelmalek
Azzi Abdelmalek 2012년 8월 6일
편집: Azzi Abdelmalek 2012년 8월 6일
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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by