SIZE Function

Returns a vector containing size and type information for the given expression.

Usage

result = SIZE(expr)

Input Parameters

expr—The expression to be evaluated.

Returned Value

result—A vector containing size and type information for expr.

Keywords

Dimensions—Returns a longword vector containing the size of each dimension of expr.

Nelements—Returns the total number of elements in expr.

Ndimensions—Returns the number of dimensions in expr. A zero is returned if expr is scalar.

Type—Returns the type code of expr.

Discussion

The returned vector is of longword type. It has the following form:

[D, S1, S2, ..., Sp, T, E]

where D is the number of dimensions of EXPRESSION (zero if EXPRESSION is scalar or undefined); Si is the size of dimension i (not present if EXPRESSION is scalar or undefined); T is the type code, encoded as shown below (the PV‑WAVE designation is shown in parentheses); and E is the number of elements in EXPRESSION.

0—Undefined

1—Byte (BYTE)

2—Integer (INT)

3—Longword integer (LONG)

4—Floating point (FLOAT)

5—Double precision floating (DOUBLE)

6—Complex single-precision floating (COMPLEX)

7—String (STRING)

8—Structure

9—UPVAR (the variable type pointed to by UPVAR)

10—List (LIST)

11—Associative array (ASARR)

12—Complex double-precision floating (DCOMPLEX)

13—32-bit integer (INT32)

See Also

N_ELEMENTS, N_PARAMS, N_TAGS, SAME, TAG_NAMES