HP Forums

Full Version: Object behaviour in CAS programming
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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
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
Reference URL's