max

Navigation:  Language Reference > Functions > Matrix >

max

Previous pageReturn to chapter overviewNext page

Syntax 1

For a matrix / vector:

y = max(A);

 

Description

Returns the value of the largest matrix / vector element of A.

 

Syntax 2

For scalars:

y = max(a,b);

 

Description

Returns the largest of the two values a or b.

 

Examples

A = [1,2;3,ramp(1)];

y = max(A);

y = max(time, 5.0); // returns at least 5.0

 

Limitations

y must be a scalar.