HP Forums
Object behaviour in CAS programming - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Object behaviour in CAS programming (/thread-6405.html)



Object behaviour in CAS programming - Tonig00 - 06-12-2016 01:13 PM

Hello

I just want to program an easy way to calculate de characteristic polynomial of a map.

In CAS mode I do the first steps very easily, I will put an example:
[[1 2],[3 7]]:=a // Asign the matrix to a variable "a"

Then I check that another variable does not exist, like for example "t"
Then I create an identity matrix of the same dimension as a and multiply by this variable:
IDENMAT(ColDim(a))*t:=tId

This product is done without problems because in CAS mode "t" is considered TYPE 8.

But if I write a progrma doing this simple multiplication it does not work either for:
1.- If I delcare the variable as LOCAL then the value is 0 and the result obviously wrong.
2.- If I do not declre the program gives an error.

Does some body knows how to avoid this problem?

Thanks in advance for your help


Just a little bug is sombody is interested:
In Spreadsheet APP if you put in a column title: =coeff(expand(x+1)^row)
then the calculator gives some extrange symbols or just blocked



RE: Object behaviour in CAS programming - cyrille de brébisson - 06-13-2016 04:59 AM

Hello,

You have to do the operation in a CAS part of the program.
You can declare a CAS section in a program by using the #cas and #end section.

Cyrille


RE: Object behaviour in CAS programming - Tonig00 - 06-14-2016 08:48 PM

Thanks very much for your answer.

I heve put this and it Works:
#cas
Su_Prop(m.l);=
BEGIN
LOCAL m1;

m-(l*IDENMAT(COLdIM(M))):=m;
return m;
END;
#end