I could you run following if statement
vec=[9 9 9]; if vec(1:3)==9 | vec(1:3)==8 | vec(1:3)==7 | vec(1:3)==6 disp('Identified') end Identified
But is there not a more efficient way to accomplish this in stead of writing all these 'or-signs' in the if statement? With vectorized code? I have tried with a for loops, but got problems when writing it under an if statement with more than one evaluation option like elseif
Best Answer