FANDOM



(89) :newMat(rows, columns)

This creates a matrix with numelements elements, in which every element is 0.

This is primarily useful because the ability to dim( of a matrix has be removed in TI-BASIC-89.

ExampleEdit

:randMat(r,c)
:Func
:Local l,i,j
:newMat(r,c)→l
:For i,1,r
::For j,1,c
:::rand(r*c)→l[i,j] 
::EndFor
:EndFor
:
:Return l
:EndFunc

This program returns a matrix with the specified dimensions and that has a random value in each element. The random numbers can be from 1 to R*C.

NOTE: All variables inside a Function must have the "Local" declaration, otherwise it will look for those variables as if they were global variables outside of the Function.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.