Main Content

normc

Normalize columns of matrix

Syntax

Description

example

normc(M) normalizes the columns of M to a length of 1.

Examples

collapse all

This example shows how to use the normc function to normalize the columns of a matrix to a length of 1.

Create the matrix, m, of which you want to normalize the columns. Then call the normc function on this matrix.

m = [1 2; 3 4];
normc(m)
ans =
     0.3162     0.4472
     0.9487     0.8944

Input Arguments

collapse all

Matrix of which you want to normalize the columns to a length of 1, specified as a matrix or a cell array of matrices.

Version History

Introduced before R2006a

See Also