norm (MathScript RT Module Function)

LabVIEW 2012 MathScript RT Module Help

Edition Date: June 2012

Part Number: 373123C-01

»View Product Info

Owning Class: linalgebra

Requires: MathScript RT Module

Syntax

k = norm(a)

k = norm(a, type)

Description

Computes the norm of a vector or matrix.

Examples

Inputs

Name Description
a Specifies a vector or matrix of double-precision, floating-point or complex double-precision, floating-point numbers.
type Specifies the norm type. type is a scalar or string. If a is a matrix, type accepts the following values.

 1 Computes the 1-norm. 2 (default) Computes the Euclidean norm. inf Computes the max-norm. 'fro' Computes the Frobenius norm.
If a is a vector, type accepts the following values.

 k Computes the k-norm. k is a positive integer. The default is 2. inf Computes the maximal absolute value of a. -inf Computes the minimal absolute value of a.

Outputs

Name Description
k Returns the norm type of a.

Details

The following table lists the support characteristics of this function.

 Supported in the LabVIEW Run-Time Engine Yes Supported on RT targets Yes Suitable for bounded execution times on RT Yes

Examples

A = [1, 2, 3; 4, 5, 6; 7, 8, 9]
C = norm(A, 'fro')