Main Content

normc

(To be removed) Normalize columns of matrix

normc will be removed in a future release. For more information, see Transition Legacy Neural Network Code to dlnetwork Workflows.

For advice on updating your code, see Version History.

Syntax

Description

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

example

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

collapse all