How to ask matlab to find mean only if there are less than 3 NaN values?
5 views (last 30 days)
How to ask matlab to find mean only if there are less than 2 NaN values in a given column, otherwise it should be NaN?
qq = [1 2 3 NaN; 1 NaN NaN NaN];
qqm = mean(qq','omitnan');
% o/p is Value: [2,1], size: 1x2, Class: Double
I want to find output like:
qqm = [2, NaN]
Any help will be greatly appriciated.