image and matrix editor
06-01-2016, 09:24 PM (This post was last modified: 06-01-2016 09:48 PM by salvomic.)
Post: #1
 salvomic Senior Member Posts: 1,366 Joined: Jan 2015
image and matrix editor
hi,
I need to create this matrix [[5,-10,15],[1,-2,3],[⅓,-⅔,1]] and then get its image.
If I create it manually in CAS I get image([[5,-10,15],[1,-2,3],[⅓,-⅔,1]]) -> [15 3 1]
But if I create the matrix in the editor (M2) I get [[5,-10,15],[1,-2,3],[0.33333...,-0.66666...,1]], and then image(M2) -> [1. 0.2 6.666666666667E-2]

I'm looking for a way to get the symbolic fractions (⅓ and -⅔) in the editor (without approximation) and the correct (normal, not divided and approximated) result for image().
Any help?
It would be nice to use the key "a b/c" for that purpose (and not for approximation), like we can do in Home...

thank you
Salvo

EDIT: for now I'm using qpimat() to get the wanted result (as normally QPI doesn't run with matrices):
Code:

#cas
qpimat(m):=
BEGIN
local s:=dim(m);
m:=mat2list(m);
m:=QPI(m)
m:=list2mat(m,s(2));
return m;
END;
#end
image(qpimat(M2)) -> [15 3 1]

∫aL√0mic (IT9CLU), HP Prime 50g 41CX 71b 42s 12C 15C - DM42 WP34s :: Prime Soft. Lib
06-08-2016, 10:30 PM
Post: #2
 Arno K Senior Member Posts: 432 Joined: Mar 2015
RE: image and matrix editor
Hi Salvo, hi Han,
when I today came across the task to solve a system of differential-equations, i.e. y'=A*y with some matrix A, which the prime happily solves with A stored in M1, one of the built-in matrices, I stumbled upon your program and clearly QPI by Han. The main reason for my search was that jordan(M1) delivered some weird looking results although I had only entered integers: M1 was
[[-3,0,1],[-2,-2,2],[-1,0,-1]]. jordan(matrix direct) worked fine. As said above I looked for a solution of my problem, found your qpimat and the needed QPI but jordan(qpimat(M1)) still produced the same weird decimal result. So either your or Han's program seem to have to be partly rewritten to produce integers for inputs in integers.
Arno
06-09-2016, 04:51 AM
Post: #3
 cyrille de brébisson Senior Member Posts: 888 Joined: Dec 2013
RE: image and matrix editor
Hello,

M0-M9 are home matrices and as such, they are floating point. So editing such matrices will not let you enter 1/2.

However, you can create a CAS matrix (a:=[[1]] in cas), and then edit that matrix in the matrix editor (it bill apear at the bottom of the list, or you can do editmat(a)) and there you can enter 1/2.

Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)