COMPUTE Statement (MATRIX-END MATRIX command)
The COMPUTE
statement carries out most of the calculations in the matrix program.
It closely resembles the COMPUTE
command in the IBM® SPSS® Statistics transformation
language.
- The basic specification is the target variable, an equals sign, and the assignment expression. Values of the target variable are calculated according to the specification on the assignment expression.
- The target variable must be named first, and the
equals sign is required. Only one target variable is allowed per
COMPUTE
statement. - Expressions that extract portions of a matrix, such as M(1,:) or M(1:3,4), are allowed to assign values. (See the topic Matrix Notation Shorthand (MATRIX-END MATRIX command) for more information. ) The target variable must be specified as a variable.
- Matrix functions must specify at least one argument enclosed in parentheses. If an expression has two or more arguments, each argument must be separated by a comma. For a complete discussion of the functions and their arguments, see Matrix Functions (MATRIX-END MATRIX command) .