How to say that "Drop the image and Move on" in MATLAB?

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)

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

Thank you for your answer. I have used "break" command. But it is not working and my loop is running and running. If you think I have to send the whole program then I can send. Because you helped me on this several times before.
Thank you again.
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.

Sign in to comment.

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Asked:

on 30 Jan 2012

Community Treasure Hunt

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

Start Hunting!