# HP Forums

Full Version: Exact Fractions in Matrices
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Can matrices only display decimal approximations on the HP Prime?

Say I have the matrix

[ [ 0.5, 0.6 ], [ 0.7, 0.8 ] ]

and I want to display the matrix in the program as

[ [ 1/2, 3/5 ], [ 7/10, 4/5 ] ].

A friend asked me how can we do this?

QPI turns matrices into lists when converting to exact values.

The command exact is ignored in Home Mode.

I had no success with propfrac or partfrac.

Is there a command that works like the [ a b/c ] key? Any help will be appreciated. Thank you.
I'm guessing the answer is no.

I just tried to create a matrix with fractions by direct input. While the fractions showed on the command line, as soon as I hit [Enter] they were replaced by approximate values.

Before pressing [Enter]:

[attachment=6879]

After pressing [Enter]:

[attachment=6880]
It works in CAS with no probs.
This is awkward but it works in Home:

CAS("string(exact(M1))")
Hi!, Eddie :
Try by creating any algorithm with p/q Form, as ...
(02-02-2019 04:19 AM)Joe Horn Wrote: [ -> ]This is awkward but it works in Home:

CAS("string(exact(M1))")

It does... except that the matrix is one line. I'm surprised that QPI does not make all the entries of a matrices in exact fraction form.

Thank you.
(02-02-2019 11:21 PM)Eddie W. Shore Wrote: [ -> ]I'm surprised that QPI does not make all the entries of a matrices in exact fraction form.

It does, but it also converts the matrix into a list of lists, because Home does not support symbolic matrices, only matrices of reals. So if you want a symbolic matrix, you'll either have to do it in CAS (or a CAS program), or convert the symbolic matrix into a form that Home can tolerate, such as a list of lists or a string. I personally like the QPI solution, even though its accuracy cannot be tuned as finely as the 'exact' function can.

Disclaimer: I *think* the above is correct, but I've almost entirely given up trying to learn how to use the HP Prime. Attempting to wrap one's brain around a constantly-moving target which is also a shape-shifter surrounded by an intermittent cloaking device is painful.
(02-03-2019 11:37 PM)Joe Horn Wrote: [ -> ]Disclaimer: I *think* the above is correct, but I've almost entirely given up trying to learn how to use the HP Prime. Attempting to wrap one's brain around a constantly-moving target which is also a shape-shifter surrounded by an intermittent cloaking device is painful.

Yikes!

But there is good news here, as this is almost certainly the first time I discovered something about an HP machine before Joe did...
I would love to have a program command that works like the [a b/c] key.
Is it my imagination or is QPI() not documented anywhere (other than in the Toolbox Catlg)? I can't find it in the User Guide.
(02-04-2019 02:40 PM)cdmackay Wrote: [ -> ]Is it my imagination or is QPI() not documented anywhere (other than in the Toolbox Catlg)? I can't find it in the User Guide.

Correct. Like many other recently-added functions (including my favorites, dfc and dfc2f), QPI has not yet been added to the User Guide.
(02-05-2019 02:13 AM)Joe Horn Wrote: [ -> ]
(02-04-2019 02:40 PM)cdmackay Wrote: [ -> ]Is it my imagination or is QPI() not documented anywhere (other than in the Toolbox Catlg)? I can't find it in the User Guide.

Correct. Like many other recently-added functions (including my favorites, dfc and dfc2f), QPI has not yet been added to the User Guide.

<scrambles to look those upâ€¦>

thanks Joe.

Some time ago someone posted a nice HTML version of the help file, which I downloaded. Sadly I can't remember whence it came, but it's the only doc I have that mentions QPI, and it's a lot easier to search than the one on the calc, even with the emulator.
(02-05-2019 03:26 PM)cdmackay Wrote: [ -> ]Some time ago someone posted a nice HTML version of the help file, which I downloaded. Sadly I can't remember whence it came...

Did you mean this thread?
(02-06-2019 05:35 AM)chromos Wrote: [ -> ]
(02-05-2019 03:26 PM)cdmackay Wrote: [ -> ]Some time ago someone posted a nice HTML version of the help file, which I downloaded. Sadly I can't remember whence it came...

Did you mean this thread?

oh! It was TimW, how embarrassing for me to forget. Yes, that was it, thanks very much indeed.

edit: and your version too, thanks!
Reference URL's
• HP Forums: https://www.hpmuseum.org/forum/index.php
• :