I’ve written a TI Basic program for the TI-84 that fits an nth degree polynomial to (n+1) ordered pairs (Thanks to those that developed the “Number-to-String” routine.). I have some other input/output and coding efficiency questions.
(1) The program is hard-coded to put the final polynomial into the Y1= equation. How can I prompt the reader to enter a desired Y= equation?
I would prefer that the user just enter 1-9, or 0 and the program would do the rest (e.g. user enters “2” and the program writes the polynomial to Y2=). If that’s not possible, it’d be OK if the user had to go through VARS:Y-VARS:FUNCTION:Y2 (as in the regression equation apps).
(2) Similar to above, the hard-coded default is for the program to assume the ordered pairs reside in L1 (for the independent variable coordinates) and L2 (for the dependent coordinates). What code can be used so that the user can direct the program as to what lists to pull the data from?
(3) Is it possible to have a null (i.e. blank) string? I use Str0 for the polynomial. To create the poly, the program loops through and adds various terms (e.g. coefficients, “x”, “^”, exponent) to the existing string. I have to start with a dummy string, I chose “0”, and then delete this leading 0 at the end using the sub( command. I’d prefer to start with a blank string. (From the “List-to-String” routine on this site it seems that a null string is not possible.)
(4) How can I “empty” a string at the end of the program? The program uses Str9 and Str0 and I would like to clear these strings at the end (to keep the calculator in the same state as it started).
(5) I create lists in the program. Can the program delete these from memory? (I’m talking about deleting and not just making the list a single entry long.)
(6) I know how to resize a matrix to [1 x 1], but how can it I do this AND not have the dimension show up on the MATRIX:NAMES screen? I use [I] and [J] and would like to empty these at the end of the program.