mean(A,weights,'includenan')| includes 
% all |NaN| values in the calculation while |wmean(A,weights,'omitnan')| ignores them.
% 
%% Example 1: 1D array
% Here's an array of values |y| and their mean without any special weighting: 

y = 0:2:10
mean(y)

%% 
% The answer above is equivalent to using |wmean| with equal weights for 
% each value in |y|: 

weight = [1 1 1 1 1 1]; 

wmean(y,weight)

%% 
% But perhaps you're doing a calculation in which the values close to zero
% are to be weighted most heavily, l