Work with Lists in Mathematica
The Table function allows you to create lists of data into recognizable patterns
effortlessly. Once the data is captured into a list, Mathematica's other functions
allow for easy data manipulation.
An Easy Example
In the following example, you create a list of sin(x) evaluated from 0 to 6 pi in intervals
of pi/2.
![[Graphics:Images/index2_gr_63.gif]](http://library.wolfram.com/howtos/lists/Images/index2_gr_63.gif)
![[Graphics:Images/index2_gr_64.gif]](http://library.wolfram.com/howtos/lists/Images/index2_gr_64.gif)
You can also create two-dimensional lists, allowing you to keep records of ordered pairs.
![[Graphics:Images/index2_gr_65.gif]](http://library.wolfram.com/howtos/lists/Images/index2_gr_65.gif)
![[Graphics:Images/index2_gr_66.gif]](http://library.wolfram.com/howtos/lists/Images/index2_gr_66.gif)
Formatting Your Lists
To view this list as a table, use the TableForm command. In this example,
% refers to the most recently evaluated results.
![[Graphics:Images/index2_gr_67.gif]](http://library.wolfram.com/howtos/lists/Images/index2_gr_67.gif)
Extracting Results
There are many ways of extracting information or specifying parts of the lists you have created. Examples using the Extract and Part commands can be seen below.
![[Graphics:Images/index2_gr_72.gif]](http://library.wolfram.com/howtos/lists/Images/index2_gr_72.gif)
![[Graphics:Images/index2_gr_73.gif]](http://library.wolfram.com/howtos/lists/Images/index2_gr_73.gif)
![[Graphics:Images/index2_gr_74.gif]](http://library.wolfram.com/howtos/lists/Images/index2_gr_74.gif)
![[Graphics:Images/index2_gr_75.gif]](http://library.wolfram.com/howtos/lists/Images/index2_gr_75.gif)
You can specify the Part function one of two ways, both of which are illustrated in the following example.
![[Graphics:Images/index2_gr_76.gif]](http://library.wolfram.com/howtos/lists/Images/index2_gr_76.gif)
![[Graphics:Images/index2_gr_77.gif]](http://library.wolfram.com/howtos/lists/Images/index2_gr_77.gif)
|