Author Topic: Inputting Data into a Matrix  (Read 2769 times)

0 Members and 1 Guest are viewing this topic.

Offline holmes221b

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 282
  • Rating: +13/-1
  • RESISTANCE IS FUTILE.
    • View Profile
    • My Livejournal
Inputting Data into a Matrix
« 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.
Code: [Select]
:Prompt A,B,C,D,E,F,G,H,I
:[[A,B,C][D,E,F][G,H,I]]->[J]

Spoiler For "Projects":
Spoiler For "Because Everyone Else Is":
*Sigh*
can we keep this on topic? The topic is about what the big thing might be, NOT SEX

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Inputting Data into a Matrix
« Reply #1 on: December 09, 2010, 03:12:27 pm »
Did you make sure you're using the [J] token and not just typing it in?
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline holmes221b

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 282
  • Rating: +13/-1
  • RESISTANCE IS FUTILE.
    • View Profile
    • My Livejournal
Re: Inputting Data into a Matrix
« Reply #2 on: December 09, 2010, 03:14:13 pm »
I am using the token.

Spoiler For "Projects":
Spoiler For "Because Everyone Else Is":
*Sigh*
can we keep this on topic? The topic is about what the big thing might be, NOT SEX

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Inputting Data into a Matrix
« Reply #3 on: December 09, 2010, 03:25:53 pm »
Yeah, I can't get it to work either.
However, you can do

Code: [Select]
List▶matr({A,D,G},{B,E,H},{C,F,I},[J]
and it will store them to the matrix.
« Last Edit: December 09, 2010, 03:26:32 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline FinaleTI

  • Believe in the pony that believes in you!
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1830
  • Rating: +121/-2
  • Believe in the pony that believes in you!
    • View Profile
    • dmuckerman.tumblr.com
Re: Inputting Data into a Matrix
« Reply #4 on: December 09, 2010, 03:28:42 pm »
I just tested the code from the first post on my calc and it works perfectly.


Spoiler For Projects:

My projects haven't been worked on in a while, so they're all on hiatus for the time being. I do hope to eventually return to them in some form or another...

Spoiler For Pokemon TI:
Axe port of Pokemon Red/Blue to the 83+/84+ family. On hold.

Spoiler For Nostalgia:
My big personal project, an original RPG about dimensional travel and a few heroes tasked with saving the world.
Coding-wise, on hold, but I am re-working the story.

Spoiler For Finale's Super Insane Tunnel Pack of Doom:
I will be combining Blur and Collision Course into a single gamepack. On hold.

Spoiler For Nostalgia Origins: Sky's Story:
Prequel to Nostalgia. On hold, especially while the story is re-worked.

Offline holmes221b

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 282
  • Rating: +13/-1
  • RESISTANCE IS FUTILE.
    • View Profile
    • My Livejournal
Re: Inputting Data into a Matrix
« Reply #5 on: December 09, 2010, 03:32:38 pm »
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.

Spoiler For "Projects":
Spoiler For "Because Everyone Else Is":
*Sigh*
can we keep this on topic? The topic is about what the big thing might be, NOT SEX

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Inputting Data into a Matrix
« Reply #6 on: December 09, 2010, 05:46:01 pm »
This code is neat, because it doesn't update the Ans variable, thus, less risks of ERR:MEMORY messages under low RAM conditions.