Author Topic: Storing values to a list  (Read 2378 times)

0 Members and 1 Guest are viewing this topic.

Offline greg701

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 10
  • Rating: +0/-0
    • View Profile
Storing values to a list
« 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

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Storing values to a list
« Reply #1 on: May 04, 2011, 01:15:44 pm »
I really need to know what language sir.

Offline greg701

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 10
  • Rating: +0/-0
    • View Profile
Re: Storing values to a list
« Reply #2 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
« Last Edit: May 04, 2011, 03:25:42 pm by greg701 »

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Storing values to a list
« Reply #3 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 :)