10-26-2020, 10:21 PM
Hello
I have no practice in programming and when I tried to develop some algebra with the HP prime to find implicit equations the program fails:
//Implicit equations by Gaus
EXPORT ImpGa(Ma1)
BEGIN
//d-dimension , c-column dimension
//n-actual column , r-row search
LOCAL d,c,n,r,Ma2;
c:=colDim(Ma1);
n:=1;
FOR n FROM n=1 TO c
DO
//Search for 1 in col n
r:=col(Ma1,n);
// RETURN r;
r:=CAS.POS(r,1);
IF r==0 THEN
r:=n;
ELSE
IF r≠n THEN
SWAPROW(Ma1,r,n);
END;
END;
Ma1:=pivot(Ma1,n,n);
END;
RETURN Ma1;
END;
When I tried to run it it gives me "Error: Invalid input".
I put in the command line:
ImpGa([[1 2 x1] [2 1 x2] [0 1 x3] [1 2 x4] [3 -1 x5]]
If I delete the columna [x1 x2 x3 x4 x5] it works.
Seems that does not accept variables in the program.
Doing the same operations manually in CAS mode it works.
Can you give some clue about how to introduce this kind of matrix in this program?
Thanks very much
Toni Garçon
I have no practice in programming and when I tried to develop some algebra with the HP prime to find implicit equations the program fails:
//Implicit equations by Gaus
EXPORT ImpGa(Ma1)
BEGIN
//d-dimension , c-column dimension
//n-actual column , r-row search
LOCAL d,c,n,r,Ma2;
c:=colDim(Ma1);
n:=1;
FOR n FROM n=1 TO c
DO
//Search for 1 in col n
r:=col(Ma1,n);
// RETURN r;
r:=CAS.POS(r,1);
IF r==0 THEN
r:=n;
ELSE
IF r≠n THEN
SWAPROW(Ma1,r,n);
END;
END;
Ma1:=pivot(Ma1,n,n);
END;
RETURN Ma1;
END;
When I tried to run it it gives me "Error: Invalid input".
I put in the command line:
ImpGa([[1 2 x1] [2 1 x2] [0 1 x3] [1 2 x4] [3 -1 x5]]
If I delete the columna [x1 x2 x3 x4 x5] it works.
Seems that does not accept variables in the program.
Doing the same operations manually in CAS mode it works.
Can you give some clue about how to introduce this kind of matrix in this program?
Thanks very much
Toni Garçon