Possible duplicate:
Working with NaN in matlab Functions
Is there one line of command that allows you to take the average value of a matrix element (ignoring NaN 's) in Matlab? For instance,
>> A = [1 0 NaN; 0 3 4; 0 NaN 2] A = 1 0 NaN 0 3 4 0 NaN 2
So mean(A) should be (1+3+2+4+0+0+0)/7 = 1.4286
In addition, I do not have access to the statistics toolbar, so I can not use nanmean()
user2005253
source share