![]() Chapter Contents |
![]() Previous |
![]() Next |
Language Reference |
raises each element to a power
The elementwise power operator (##) creates a new matrix with elements that are the elements of matrix1 raised to the power of the corresponding element of matrix2. If any value in matrix1 is negative, the corresponding element in matrix2 must be an integer.
In addition to handling conformable matrices, the elementwise power operator allows either operand to be a scalar. In this case, the operation takes the power for each element and the scalar value. Missing values are propagated if they occur.
For example, the statements
a={1 2 3}; b=a##3;result in
B 1 row 2 cols (numeric) 1 8 27The statement
b=a##.5;results in
B 1 row 3 cols (numeric) 1 1.4142136 1.7320508
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.