Element-wise operations: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 1,295:
[4.0, 16.0, 36.0]
</pre>
 
=={{header|Maple}}==
<lang Maple>
# Built-in element-wise operator ~
 
#addition
<1,2,3;4,5,6> +~ 2;
 
#subtraction
<2,3,1,4;0,-2,-2,1> -~ 4;
 
#multiplication
<2,3,1,4;0,-2,-2,1> *~ 4;
 
#division
<2,3,7,9;6,8,4,5;7,0,10,11> /~ 2;
 
#exponentiation
<1,2,0; 7,2,7; 6,11,3>^~5;</lang>
{{Out|Output}}
<lang Maple>
Matrix(2, 3, [[3, 4, 5], [6, 7, 8]])
</lang>
 
 
=={{header|Mathematica}} / {{header|Wolfram Language}}==
Anonymous user