Skip to Main Content Skip to Search
Product Documentation

size - Class: dataset

Size of dataset array

Syntax

D = SIZE(A)
[NOBS,NVARS] = SIZE(A)
[M1,M2,M3,...,MN] = SIZE(A)
M = size(A,dim)

Description

D = SIZE(A) returns the two-element row vector D = [NOBS,NVARS] containing the number of observations and number of variables in the dataset A. A dataset array always has two dimensions.

[NOBS,NVARS] = SIZE(A) returns the numbers of observations and variables in the dataset A as separate output variables.

[M1,M2,M3,...,MN] = SIZE(A), for N > 2, returns M1 = NOBS, M2 = NVARS, and M3,..,MN = 1.

M = size(A,dim) returns the length of the dimension specified by the scalar dim:

See Also

length | ndims | numel

  


 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS