%% Covariance Excluding NaN
% Create a matrix and compute its covariance, excluding any rows containing NaN values.

A = [1.77 -0.005 3.98; NaN -2.95 NaN; 2.54 0.19 1.01]

%

C = cov(A,'omitrows')

% Copyright 2015 The MathWorks, Inc.