time | Calls | line |
---|
| | 1 | function varargout = size(a,varargin)
|
| | 2 | %SIZE Size of a categorical array.
|
| | 3 | % D = SIZE(A), for an M-by-N categorical matrix A, returns the two-element
|
| | 4 | % row vector D = [M,N] containing the number of rows and columns in the
|
| | 5 | % matrix. For N-D categorical arrays, SIZE(A) returns a 1-by-N vector of
|
| | 6 | % dimension lengths. Trailing singleton dimensions are ignored.
|
| | 7 | %
|
| | 8 | % [M,N] = SIZE(A), for a categorical matrix A, returns the number of rows
|
| | 9 | % and columns in A as separate output variables.
|
| | 10 | %
|
| | 11 | % [M1,M2,M3,...,MN] = SIZE(A), for N>1, returns the sizes of the first N
|
| | 12 | % dimensions of the categorical array A. If the number of output arguments
|
| | 13 | % N does not equal NDIMS(A), then for:
|
| | 14 | %
|
| | 15 | % N > NDIMS(A), SIZE returns ones in the "extra" variables, i.e., outputs
|
| | 16 | % NDIMS(A)+1 through N.
|
| | 17 | % N < NDIMS(A), MN contains the product of the sizes of dimensions N
|
| | 18 | % through NDIMS(A).
|
| | 19 | %
|
| | 20 | % M = SIZE(A,DIM) returns the lengths of the specified dimensions in a
|
| | 21 | % row vector. DIM can be a scalar or vector of dimensions. For example,
|
| | 22 | % SIZE(A,1) returns the number of rows of A and SIZE(A,[1,2]) returns a
|
| | 23 | % row vector containing the number of rows and columns.
|
| | 24 | %
|
| | 25 | % M = SIZE(A,DIM1,DIM2,...,DIMN) returns the lengths of the dimensions
|
| | 26 | % DIM1,...,DIMN as a row vector.
|
| | 27 | %
|
| | 28 | % [M1,M2,...,MN] = SIZE(A,DIM) OR [M1,M2,...,MN] = SIZE(A,DIM1,...,DIMN)
|
| | 29 | % returns the lengths of the specified dimensions as separate outputs.
|
| | 30 | % The number of outputs must equal the number of dimensions provided.
|
| | 31 | %
|
| | 32 | %
|
| | 33 | % See also LENGTH, NDIMS, NUMEL.
|
| | 34 |
|
| | 35 | % Copyright 2006-2019 The MathWorks, Inc.
|
| | 36 |
|
| | 37 | % Call the built-in to ensure correct dispatching regardless of what's in dim
|
< 0.001 | 513 | 38 | varargout = cell(1,max(nargout,1));
|
< 0.001 | 513 | 39 | if nargin == 1
|
0.006 | 507 | 40 | [varargout{:}] = builtin('size',a.codes);
|
< 0.001 | 6 | 41 | else
|
< 0.001 | 6 | 42 | [varargout{:}] = builtin('size',a.codes,varargin{:});
|
< 0.001 | 513 | 43 | end
|
Other subfunctions in this file are not included in this listing.