Omnimaga

Calculator Community => TI Calculators => TI-BASIC => Topic started by: greg701 on May 04, 2011, 01:12:10 pm

Title: Storing values to a list
Post by: greg701 on May 04, 2011, 01:12:10 pm
How do I store values to a list in a program?

Basically what I want to do is say store numbers in a list.

e.g. { 11, 12, 14, 16, 19 }

I then want to calculate the difference of two adjacent terms and store these in another list, e.g.

{ 1, 2, 2, 3 }

and so on

{ 1, 0, 1 }
{ -1, 1 }
{ 2 }

How would I go about programming this? I do even know how to create lists. Any help would be much obliged :)

Thanks

Greg
Title: Re: Storing values to a list
Post by: Munchor on May 04, 2011, 01:15:44 pm
I really need to know what language sir.
Title: Re: Storing values to a list
Post by: greg701 on May 04, 2011, 02:01:00 pm
Sorry i'm using a TI-Nspire Non cas and it's TI-Nspire Basic

Thanks Very much
Title: Re: Storing values to a list
Post by: Deep Toaster on May 06, 2011, 06:14:31 pm
I was stuck on this myself until someone pointed out to me that to access an element of a list in Nspire BASIC, it's LIST[ELE]. For example, if you had a list that looked like nums:={1,2,3,4,5}, you could change the three to a twelve with nums[3]:=12. Or if you prefer → notation, 12→nums[3]. Hope that helps :)