Omnimaga
Calculator Community => TI Calculators => TI-BASIC => Topic started by: holmes221b on December 09, 2010, 03:10:39 pm
-
I was flipping through my pre-calculus textbook the other day and I came across a problem involving cryptography and matrices, specifically something called a Q32 Fibonacci encryption matrix. Being the sort of person I am, I immediately decided I needed to code a TI-BASIC program utlizing this method of encryption.
But the only problem is that I can't seem to figure out/remember how to input data into a matrix--I keep getting either ERR: DIM or ERR: DATA TYPE for the key matrix, no matter what I try.
And how would one go about inputting user selected variables into a matrix? I've currently got the following bit of code in my cal for this, but until I can figure out how to input data into a matrix the code remains untested.
:Prompt A,B,C,D,E,F,G,H,I
:[[A,B,C][D,E,F][G,H,I]]->[J]
-
Did you make sure you're using the [J] token and not just typing it in?
-
I am using the token.
-
Yeah, I can't get it to work either.
However, you can do
Listâ–¶matr({A,D,G},{B,E,H},{C,F,I},[J]
and it will store them to the matrix.
-
I just tested the code from the first post on my calc and it works perfectly.
-
Huh, whatever was the problem with the code when I first tried it, it's working now that I've added a menu to the program. xD
Thanks for your help though. I might just use your suggestion anyways in this code, it looks much neater than storing the values straight to the matrix.
-
This code is neat, because it doesn't update the Ans variable, thus, less risks of ERR:MEMORY messages under low RAM conditions.