I am using an if statement to determine whether entries in matrices are non-zero. If I write the code
if matrixarray(1,1)~=0 % do some operation
elseif matrixarray(2,1)~=0 % do some other operation
end
I realise that there is the possibility that the first matrix element might be non-zero and the second might also be non-zero. If this happens, will the code just run the first part of the if statement as this is what it sees first or will it run both conditions?
Best Answer