27.03.2013 Views

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

918 MATRIX—END MATRIX<br />

Example<br />

{11;12;13}<br />

• This example represents a column vector:<br />

Example<br />

{3}<br />

11<br />

12<br />

13<br />

• This example represents a scalar. The braces are optional. You can specify the same scalar<br />

as 3.<br />

Matrix Notation Shorthand<br />

You can simplify the construction of matrices using notation shorthand.<br />

Consecutive Integers. Use a colon to indicate a range of consecutive integers. For example,<br />

the vector {1,2,3,4,5,6} can be written as {1:6}.<br />

Incremented Ranges of Integers. Use a second colon followed by an integer to indicate the increment.<br />

The matrix {1,3,5,7;2,5,8,11} can be written as {1:7:2;2:11:3},<br />

where 1:7:2 indicates the integers from 1 to 7 incrementing by 2, and 2:11:3 indicates<br />

the integers from 2 to 11 incrementing by 3.<br />

• You must use integers when specifying a range in either of these ways. Numbers with fractional<br />

parts are truncated to integers.<br />

• If an arithmetic expression is used, it should be enclosed in parentheses.<br />

Extraction of an Element, a Vector, or a Submatrix<br />

You can use indexes in parentheses to extract an element from a vector or matrix, a vector<br />

from a matrix, or a submatrix from a matrix. In the following discussion, an integer index<br />

refers to an integer expression used as an index, which can be a scalar matrix with an integer<br />

value or an integer element extracted from a vector or matrix. Similarly, a vector index<br />

refers to a vector expression used as an index, which can be a vector matrix or a vector<br />

extracted from a matrix.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!