MATLAB: I have a mxn matrix. How to change its elements to either 1 or 0 based on a condition such as: if an element of mxn is

conditionelseifif statement

regards

Best Answer

% A is your matrix
A(A<=145)=0
A(A>145)=1