Search code examples
ti-basic

Trying to display what position the matrix editor is at


I have a TI-84 Plus CE (although I kind of want it to be backwards compatible, and compatible with the nSPIRE and TI-84 Plus)

I am trying to output onto the screen what position the matrix editor is at, and I am getting an ERROR:syntax, although (to the best of my knowledge about this language) the statement is valid.

my code is:

:Input "NUM OF ROWS?",A :Input "NUM OF COLUMNS?",B :{A,B}->dim([A]) :For(R,1,A) :For(C,1,B) :Disp "LOCATION: ("R","C")" :Input "VALUE?",E :E->[A](C,D) :End :End :ChiSquared-Test([A],[B])

side note: i'm also getting a "divide by zero error" on the chi-squared test, for an unknown reason.


Solution

  • Fixed The Problem!

    FIX: Disp "Matrix Location:",{R,C}

    The Reason the error happened was because in TI Basic, the option to have variables displayed outside the text is not available, so you have to do a 2 line display with the description in the first line, and the matrix location in the next line.

    (R,C) when in a Disp statement throw an error, so you need to use the curly brackets instead like so: {R,C}.