HP Forums
anti-Identity matrix for Casio calculators - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: Not HP Calculators (/forum-7.html)
+--- Forum: Not remotely HP Calculators (/forum-9.html)
+--- Thread: anti-Identity matrix for Casio calculators (/thread-10761.html)



anti-Identity matrix for Casio calculators - klesl - 05-18-2018 07:54 AM

This small code creates m×n anti-Identity matrix. It is for fx-9860 and similar calcs with matrix. For using with ClassPad the code has to be adapted which is very easy.
An enter is pressed at the end of row.
ClrText
"Dim"?->M:M->I:{M,M}->Dim Mat A/put here an output triangle - opt./
Fill(1,Mat A):Mat A/put here an output triangle- opt./
Do
0->Mat A [I, I]
I-1->I
LpWhile I>0
Mat A/put here an output triangle/

Description:
The Idea is simple- create square M×M zero matrix and replace values in the diagonal cells

1. Command "Dim" creates square M×M zero matrix
2. Command "Fill" replaces zero elements with 1
3. Command "Do" repeats the loop till the condition I>0
4. 0->Mat A [I, I] assigns 0 to all diagonal cells
5. Command "lpWhile" ends the loop when the condioit is achieved
---------------------------------------------
Variables:
M - dimension of Matrix
I - index of cell position (30, 29, 28)
[I.I] - index of diagonal cells
Mat A - created matrix A
---------------------------------------------
Notes: You can delete the first two triangles marked as opt., because I use them for visual checking of created matrix
Also You can add the "Det" command (Det Mat A) at the end of the program to calculate the determinant automatically


RE: anti-Identity matrix for Casio calculators - brickviking - 05-18-2018 11:55 PM

Thanks for that. I knew it must have been something simple, but I wasn't sure how to do it at the time that I asked. I did try making a 30x30 matrix on the older calculator (the 9750g+), but though I could create the matrix, I couldn't then work with it (then duplicating its contents into Mat Ans) because there simply wasn't enough room left on the calculator when I had other programs installed as well.

(Post 225)