MATLAB Functions Help Desk

length

Purpose

Length of vector

Syntax

Description

The statement length(X) is equivalent to max(size(X)) for nonempty arrays and 0 for empty arrays.

n = length(X) returns the size of the longest dimension of X. If X is a vector, this is the same as its length.

Examples

See Also

ndims       Number of array dimensions

size        Array dimensions



[ Previous | Help Desk | Next ]