| Understanding the Interactive Matrix Language |
Matrix literals with multiple elements
have the elements enclosed in braces.
Use commas to separate the rows of a matrix.
For example, the following statement assigns a row vector to the matrix
:
x={1 2 3 4 5 6};
Here is the resulting matrix:
X
1 2 3 4 5 6
The following statement assigns a column vector to the matrix
y={1,2,3,4,5};
Here is the resulting matrix:
Y
1
2
3
4
5
The following statement assigns a
z={1 2, 3 4, 5 6};
Here is the resulting matrix:
Z
1 2
3 4
5 6
The following statement creates a matrix
w=3#z;
Here is the resulting matrix:
W
3 6
9 12
15 18
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.