I have an n x n matrix in MATLAB. I am trying to iterate through each row and column of this matrix. If the value in each element is higher than a certain threshold, I want to replace that element with a 1. If the value in each element is lower than a certain threshold, I want to replace that element with a 0.
I am trying to use two for loops, but it's not leading me anywhere.Any suggestions?