Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I iterate through a list in a TI-83 calculator program

Tags:

list

ti-basic

I created a set of programs to calculate the area under a graph using various methods of approximation (midpoint, trapezoidal, simpson) for my Calculus class.

Here is an example of one of my programs (midpoint):

Prompt A,B,N
(A-B)/N->D
Input "Y1=", Y1
0->X
0->E
For(X,A+D/2,b-D/2,D)
Y1(x)+E->E
End
Disp E*D

Instead of applying these approximation rules to a function (Y1), I would like to apply them to a list of data (L1). How do I iterate through a list? I would need to be able to get the last index in the list in order for a "For Loop" to be any good. I can't do anything like L1.length like I would do in Java.

like image 992
James T Avatar asked Nov 16 '10 00:11

James T


People also ask

How do you enter a list on a TI 83 Plus?

Create your TI 83 List Data. Step 1: Press the STAT button and then press ENTER to go into “edit” mode. Step 2: Type a number (for example “12”) and then press the ENTER key. Continue entering numbers, pressing the ENTER key after each entry.

How do you store a value in a list on a TI-84?

Press the [STO>] key. Press [Enter] to store the numbers.


1 Answers

You can obtain the length of the list using dim(). That can be found in 2nd->LIST->OPS->dim(. Just make sure that you use a list variable otherwise dim() will complain about the type. You could then index into the list with a subscript.

e.g.,

{1, 2, 3, 4} -> L1
For (X, 1, dim(L1), 1)
Disp L1(X)
End
like image 174
Jeff Mercado Avatar answered Sep 25 '22 02:09

Jeff Mercado