Apply a callback to an array: Difference between revisions
Content added Content deleted
(Added Mathematica) |
|||
Line 810: | Line 810: | ||
2 4 6 |
2 4 6 |
||
</pre> |
</pre> |
||
=={{header|Mathematica}}== |
|||
<lang Mathematica>(#*#)& /@ {1, 2, 3, 4} |
|||
Map[Function[#*#], {1, 2, 3, 4}]</lang> |
|||
=={{header|MATLAB}}== |
=={{header|MATLAB}}== |