%% Variance Excluding NaN
% Create a vector and compute its variance, excluding NaN values.

A = [1.77 -0.005 3.98 -2.95 NaN 0.34 NaN 0.19];
V = var(A,'omitnan')

% Copyright 2015 The MathWorks, Inc.