MATLAB Function Reference |

**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**

legendre | length (serial) |