Chapter Contents |
Previous |
Next |

Understanding the Language |

Matrix literals with multiple elements have the elements enclosed in braces. Use commas to separate the rows of a matrix. For example, the statement

x={1 2 3 4 5 6};assigns a row vector to the matrix

X 1 2 3 4 5 6The statement

y={1,2,3,4,5};assigns a column vector to the matrix

Y 1 2 3 4 5The statement

z={1 2, 3 4, 5 6};assigns a 3 ×2 matrix literal to the matrix

Z 1 2 3 4 5 6The following assignment

w=3#z;creates a matrix

W 3 6 9 12 15 18

Chapter Contents |
Previous |
Next |
Top |

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.