Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Array size

`sz = size(A)`

`szdim = size(A,dim)`

```
[m,n] =
size(A)
```

`[sz1,...,szN] = size(A)`

returns
a row vector whose elements contain the length of the corresponding
dimension of `sz`

= size(`A`

)`A`

. For example, if `A`

is
a 3-by-4 matrix, then `size(A)`

returns the vector ```
[3
4]
```

. The length of `sz`

is `ndims(A)`

.

If `A`

is a table or timetable, then `size(A)`

returns
a two-element row vector consisting of the number of rows and the
number of table variables.

`[`

returns
the length of each dimension of `sz1,...,szN`

] = size(`A`

)`A`

separately.