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.
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.
Press the [STO>] key. Press [Enter] to store the numbers.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With