%% Vector and Matrix Data
% Normalize data in a vector and matrix by computing the z-score.
% Create a vector v and compute the z-score, normalizing the data to have mean 0 and standard deviation 1.

v = 1:5;
N = normalize(v)

% Create a matrix B and compute the z-score for each column. Then, normalize each row.

B = magic(3)
N1 = normalize(B)
N2 = normalize(B,2)

% Copyright 2012 The MathWorks, Inc.