Hi MATLAB community,
I wrote a code for identify 999999 to substitute to NaN, my purpose is replace NaN to mean of column data,
I tried follow code:
[l,c]=size(matrix) % size (324,25)
for w=1:c for q = 1:l if matrix(q,w)==999999 matrix(q,w) =NaN; matrix(isnan(matrix))= mean(matrix(:,w),'omitnan'); % in the case NaN is present in column 21, it will substitute the element for mean of all element in column 21
end endend
Could help me?
Grateful
Best Answer