Investment Studio > Expressions > Functions > Matrix > MOP
array mop(string operation_string, array data [, ...])
Returns an array with the same dimensions as the data array(s), containing the results of the operation described by operation_string, performed element by element on the contents of the data array(s).
The operation_string can contain an operator (as in "+") or a function name followed by an empty pair of parentheses, as in "sin()". The number of data arrays must match the number of arguments required by the operation. The arguments used to compute the value in a given position of the result array are taken from the corresponding position in each data array.
All data arrays must have the same dimensions.
Examples
=mop("sin()", {{1, 0}, {pi, pi/2}})
is equivalent to
={{sin(1), sin(0)}, {sin(pi), sin(pi/2)}}
and equals {{0.841470984807897 , 0}, {1.22460635382238E-16 , 1}}
=mop("&", {{"a", "b"}, {"c", "d"}}, {{"e", "f"}, {"g", "h"}})
is equivalent to
={{"a" & "e", "b" & "f"}, {"c" & "g", "d" & "h"}}
and equals {{"ae", "bf"}, {"cg", "dh"}}
=mop("atan2()", {{1, 2}, {3, 4}}, {{5, 6}, {7, 8}})
is equivalent to
={{atan2(1, 5), atan2(2, 6)}, {atan2(3, 7), atan2(4, 8)}}
and equals {{1.37340076694502, 1.24904577239825}, {1.16590454050981, 1.10714871779409}}.
See also index.