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 Related SolutionsMATLAB: How to center a matrix containing NaN values if you statistic toolboxxctr=bsxfun(@minus, x, nansum(x)/size(x, 1)); MATLAB: Correlation between two row matrices Like that, each value of "a" is correlated to each value of "b", but applying the formula of the correlation, the correlation of two single numbers is NaN. To compute the correlation correctly, traspose the input vectorsresult = corr(a', b'); Related QuestionReplace values in matrixReplace one NAN with zero in a row vector without a loopReplace values in a matrixI have (double type) matrix where I have NaN values. I want to change all NaN values to 0 value. How Can I do thatReplacing value in satellite image.
Best Answer