hello i have three loops and two conditions and flag and i'm trying to use break statement to break the loop after the second condition true but what i get two variables having same value which is impossible what wrong
temp=0;cov=0;sov=0;for I=1:30 for J=1:30 for N=1:x dis=sqrt(((I-test_ary(N,2)).^2)+((J-test_ary(N,1)).^2)); if(dis<=r) if (temp==0) cov=cov+1; temp=1; else if(temp==1) sov=sov+1; temp=0; break end end end end endend
Best Answer