# Making Tables of Values

You can use lists as tables of values. You can generate the tables, for example, by evaluating an expression for a sequence of different parameter values.

In[1]:= |

Out[1]= |

In[2]:= |

Out[2]= |

In[3]:= |

Out[3]= |

In[4]:= |

Out[4]= |

In[5]:= |

Out[5]= |

In[6]:= |

Out[6]= |

In[7]:= |

Out[7]= |

In[8]:= |

Out[8]//TableForm= | |

All the examples so far have been of tables obtained by varying a single parameter. You can also make tables that involve several parameters. These multidimensional tables are specified using the standard *Mathematica* iterator notation, discussed in "Sums and Products".

In[9]:= |

Out[9]= |

The table in this example is a *list of lists*. The elements of the outer list correspond to successive values of . The elements of each inner list correspond to successive values of , with fixed.

Sometimes you may want to generate a table by evaluating a particular expression many times, without incrementing any variables.

In[10]:= |

Out[10]= |

In[11]:= |

Out[11]= |

In[12]:= |

Out[12]= |

In[13]:= |

Out[13]= |

In[14]:= |

Out[14]= |

You can use Table to generate arrays with any number of dimensions.

In[15]:= |

Out[15]= |

Table[f,{i_{max}}] | give a list of values of f |

Table[f,{i,i_{max}}] | give a list of the values of f as i runs from to |

Table[f,{i,i_{min},i_{max}}] | give a list of values with i running from to |

Table[f,{i,i_{min},i_{max},di}] | use steps of di |

Table[f,{i,i_{min},i_{max}},{j,j_{min},j_{max}},...] | generate a multidimensional table |

Table[f,{i,{i_{1},i_{2},...}] | give a list of the values of f as i successively takes the values , , ... |

TableForm[list] | display a list in tabular form |

Functions for generating tables.

You can use the operations discussed in "Manipulating Elements of Lists" to extract elements of the table.

In[16]:= |

Out[16]= |

In[17]:= |

Out[17]= |

In[18]:= |

Out[18]= |

In[19]:= |

Out[19]= |

In[20]:= |

Out[20]= |

In[21]:= |

Out[21]= |

In[22]:= |

Out[22]= |

In[23]:= |

Out[23]//TableForm= | |

t[[i]] or Part[t,i] | give the i sublist in t (also input as ) |

t[[i;;j]] or Part[t,i;;j] | give a list of the parts i through j |

t[[{i_{1},i_{2},...}]] or Part[t,{i_{1},i_{2},...}] | give a list of the , , ... parts of t |

t[[i,j,...]] or Part[t,i,j,...] | give the part of t corresponding to |

Ways to extract parts of tables.

As mentioned in "Manipulating Elements of Lists", you can think of lists in *Mathematica* as being analogous to "arrays". Lists of lists are then like two-dimensional arrays. When you lay them out in a tabular form, the two indices of each element are like its and coordinates.