length

Returns the length of an object's largest dimension.

Syntax

R = length(a)

Inputs

a
Any valid scalar | string | vector | matrix
Type: double | integer | char | string | logical | struct | cell
Dimension: scalar | string | vector | matrix

Outputs

R
scalar

Examples

R = length([1 2 6; 3 4 5])
R = 3