Hi Guys, I had the following line for a condition I needed.
if (abs((tempBeforeDelam(i,j,1)-tempBeforeDelam(i,j,2)))< 1 ... && abs((tempBeforeDelam(i,j,2)-tempBeforeDelam(i,j,3))) < 1 ... && abs((tempBeforeDelam(i,j,3)-tempBeforeDelam(i,j,4))) < 1 ... && abs((tempBeforeDelam(i,j,4)-tempBeforeDelam(i,j,5))) < 1 ... && abs((tempBeforeDelam(i,j,5)-tempBeforeDelam(i,j,1))) < 1)
and replaced it with
if all( abs( diff([ squeeze(tempBeforeDelam(i,j,:)); tempBeforeDelam(i,j,1) ]) ) < 1)
now I also need to incorporate a condition that says that even if the difference is nan proceed to the next step.
Any help would be appreciated.
Thanks
Best Answer