MATLAB: How to replace values less than equal to zero values in a matrix

MATLAB

I have a marix of 44450*8 dimention, which contain some zero and negative values, I want to replace them with NaN. how to do that?

Best Answer

myMatrix( myMatrix <= 0 ) = NaN