Create an account on the HP Community to personalize your profile and ask a question
11-22-2019 10:00 AM
Tools like Solve linear system return the result in some kind of array/vector/matrix.
How can I steal each of the items of this vector and store them on different variables ?
I need to store 0123 on variable A and 5555 on variable B
11-22-2019 08:12 PM
If you keep your 50g in Algebraic mode, please ignore this reply, since it assumes that you're in RPN mode.
Here are two ways to extract the contents of a vector or matrix:
Method #1: The OBJ→ command (in the PRG TYPE menu) explodes all the elements of a vector or matrix onto the stack, and leaves the dimensions on level 1.
Method #2: The V→ command (in the MTH VECTOR menu) explodes a vector's elements onto the stack, without leaving the dimension on the stack.
After using either of the above methods, storing the separate stack levels into variables is straightforward.
Hope that helps! Disclaimer: I don't work for HP. I'm just another happy HP calculator user.
11-23-2019 01:49 PM
There's not much in the way of documentation or "community expertise" with regards to using the 50g in algebraic mode. The time spent becoming familiar with RPN mode usually pays off immensely in terms of documentation, tools, and user assistance from others using their 50g in similar ways. I would strongly encourage you to consider using RPN mode to get the most out of your calculator.
That said, I believe the first problem you ran into is that OBJ→ in the first case is acting on the "outermost object grouping", which in this case is the tagged-composite level. The result of OBJ→ in this situation is to split the tag apart from its encapsulated object (the matrix in this case). You can see that in the result. Using DTAG first, then OBJ→ will give you the actual output that you need, but note that the resulting list contains an embedded list with the dimensions of the original matrix. So you'll have to deal with that in subsequent operations (see the SUB command for specifying the needed range of list contents).
V→ doesn't care about the tag ("Solutions"), but it's looking for a vector, and you're passing it single-column matrix instead. That's the reason for the error for that attempt.
This would be a bit easier in RPN mode, but would still take several steps. The end result would be easy to store in global variables simply by providing a list of those variable names to the STO command. I'm not sure if that's even possible with algebraic mode, however.