A scalar is a single valued double precision real numeric variable. A scalar can be used wherever a single numeric value is expected. Indices have no meaning, and so are not allowed on scalars.
A literal scalar can be a single number, such as, 3.456, or an
expression that results in a single number, such as
LEN(x)+2.
The following table shows the possible ways that variables can be considered to be equivalent to scalars, that is, can be used wherever scalars are expected.
Let a and b be scalars. Suppose that M
is a matrix, V is a vector, and S is a scalar
S | = | the value of S |
V[a] | = | the value stored in the ath
element of V |
M[a,b] | = | the value stored in row a and
column b of M |