I have a 1000x7 matrix whose columns present some values equal to -99.
I want to compute the mean of each column separately because I'm building a table using fprintf, but I want the mean to be computed excluding the -99 values.
For instance, taking matrix A, I've tried
mean(A(A(:,1) ~= -99))
and it works for the computation of the first column mean.
However, when I try
mean(A(A(:,2) ~= -99))
for the second column, the result is exactly equal to the result of the first column.
What's wrong in that? Thanks a lot in advance for your tips!