How to say that "Drop the image and Move on" in MATLAB?
Show older comments
Hi, I am working on Image processing. I have a code like this:
for i= 1:N
baseFileName = IMAGES{i};
PIP=0
i1= 80
i2= 710
k=0
while (PIP ~=8)
k=k+1
Here i1,i2 and k are some parameter of images.
After this I have to write like " If K>100", then "Drop the image and go on with the next image". But I am not that expert to write the program for the "Drop the image and go on with the next image" portion.
Would anyone please help me for this?
Thanks in advance.
Answers (1)
Image Analyst
on 30 Jan 2012
0 votes
Use the "continue" command to skip to the bottom of a loop but keep on processing the next iteration of the loop. Using break will immediately get you out of the loop.
2 Comments
Shamim Rahman
on 31 Jan 2012
Image Analyst
on 31 Jan 2012
Break should work. You might have to use it again if you're nested deeply and need to bail out of more than one loop.
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!