Dear colleagues, I have the following for..loop which I need to vectorize; "img1" is an image of size M*N: 

***********************************************************

for c=Cmin:Cmax

for r=Rmin:Rmax

if(img1(r, c)==1)

x1 = r;

y1 = c;

break;

end

end

end

*******************************

The problem is how to include the "if" condition (without "if", I could easily vectorize). Any idea please.

More Baraka Maiseli's questions See All
Similar questions and discussions