06-24-2018 07:27 PM
Here's one way:
(assumption: RPN mode)
1) If your target object is a vector or matrix, issue the AXL command to convert it to a list.
2) Create a small program object containing the function you want to apply. For example, if you wanted to apply the SIN function to all elements, create a program that looks like this:
« SIN »
3) Execute the MAP command.
4) The result is a list with the function applied to each element. If you need to convert this back into a matrix/vector, just execute another AXL command.
Replace the SIN function in step 2 with whatever function(s) you wish.
Using your example, if I had a matrix that I wished to apply the COLLECT command to, I'd do the following:
AXL « COLLECT » MAP AXL
For more information about the AXL and MAP commands, see the Advanced User's Reference which is available here.
Hope this helps!
06-25-2018 06:00 AM
MAP can be applied directly to a matrix:
[[ 1 2 3 ] [ 4 5 6 ] [ 7 9 9 ]] << SQ >> MAP will give [[ 1 4 9 ] [ 16 25 36 ] [ 49 64 81 ]]
See page 3-141 of the AUR ( HP-50G Advanced User's Reference )