%% Specify Dimension for Variance
% Create a matrix and compute its variance along the first dimension.

A = [4 -2 1; 9 5 7];
var(A,0,1)

%
% Compute the variance of A along the second dimension.

var(A,0,2)

% Copyright 2015 The MathWorks, Inc.