[ti basic] matrix manipulation
Moderator: MaxCoderz Staff
For matrics:
such as I want a 3 to be in the 1,1 position then I would 3->[A](1,1
So you just want to change a number, then just [A](A,BBASIC Code wrote::ClrHome
:[[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1][1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1][1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1][1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1][1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1][1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1][1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1][1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1[A]
:For(A,1,8
:For(B,1,16
:Output(A,B,sub(" O",[A](A,B)+1,1
:End
:End
:2A:2B
:[A](A,B
:Repeat Ans=1
:Repeat Ans
:getKey
:End
:AC:BD
:B+(=26)-(=24B
:A+(=34)-(=25A
:If [A](A,B:Then
:CA:DB:End
:Output(C,D,"
:Output(A,B,"O
such as I want a 3 to be in the 1,1 position then I would 3->[A](1,1
There's a whole section in the manual about it. If you don't have a manual(or have the mini 84 series manual), here is the 83+/SE manual, and here is the complete 84+/SE manual. Chapter 10 deals with matrixes.
In Memory of the Maxcoderz Trophy
You might want to get help from http://www.unitedti.org, as they have many 68k programmers.
- KermMartian
- Calc Wizard
- Posts: 549
- Joined: Tue 05 Jul, 2005 11:28 pm
- Contact:
-
- Calc Wizard
- Posts: 526
- Joined: Tue 08 Mar, 2005 1:37 am
- Location: who wants to know?
- Contact:
Close to the same deal:Loki wrote:Ok, so how exactly would you use them on an 89Ti?
Code: Select all
[[1,2][3,4]]->mat1
Code: Select all
[1,2;3,4]->mat2
Code: Select all
newMat(2,3)->mat3
Code: Select all
seq(seq(i*j,j,1,2),i,1,2))->mat4
Code: Select all
["hello",x+1;-5,"world]
Code: Select all
mat1[1,2]
Code: Select all
"matrices are fun"->mat1[1,2]
Code: Select all
augment(mat1,mat2)
Code: Select all
augment(mat1;mat2)
Code: Select all
dim(mat1)
Code: Select all
rowDim(mat1)
Code: Select all
colDim(mat1)
you can't store to dim(), rowDim(), or colDim(). However, you can use augment to increase a matrix's size. To get a submatrix, use:
Code: Select all
subMat(mat1,startRow,StartCol,endRow,endCol)
We do visit maxcoderz occasionally as well.You might want to get help from http://www.unitedti.org, as they have many 68k programmers.