1.8. Lists, arrays and operations

Definition: {e1, e2, ...,en} is a list of elements. Elements can be objects of very general type: numbers, expressions, lists, graphics, ...

Function   Action   
 
{a1,a2,.....}    Generates one-dimensional list with elements a1,a2,... Can be memorised as arbitrary variable, for instance tt ={1,2,3}
{{b1,b2,...},{c1,c2,...}, ...}   Generates a matrix with the first row  b1,b2,... the second row  c1,c2,...
Table[ f , {n}] Generates a vector of n equal elements f, i.e. the list {f,f,...,f}
Table[ f , {i, n}]Generates a vector with n elements  f(i), i=1,...,n.
Table[ f , {i, imin, imax}]Generates a vector with elements  f(i), i=imin, ... imax
Table[ f , {i, imin, imax, di}]Generates a vector with elements  f(i), i=imin, ... imax  incremented by step di.
TableForm[ list ]Shows the elements of the list vertically and without any separators
ColumnForm[ list ]   Shows the list elements in colomns
% // TableForm  Shows vertically the previous Mathematica Kernel result.      
 
Array[ a, n ]Defines an array {a[1],a[2],..., a[n]} of general type of elements
Range[ n ]Generates the list of integers {1,2,...,n}
Range[ n1,n2]Generates the list of integers from  n1  to  n2.
Range[ n1,n2, di ]Generates the list of integers from  n1  to  n2  by step di  
list[ [ i ] ]    or   Part[list, i ]Extracts the i-th element of the list
list[ [ i, j ] ] or Part[list, i ,j ]  Extracts the (i,j)-th element of the matrix list
Lenght[ list ]  Counts the number of elements in list
 
Table[ f, {i, imax}, {j, jmax} ]Generates a rectangular table (matrix) indexed  f _ (i, j ) , i=1,2,..., imax  and  j=1,2,..., jmax
Array[ a, {m,n}] Defines a two-dimensional array of elements of general objects  a[i,j]
IdentityMatrix[ n ]Generates identity matrix of order  n
DiagonalMatrix[ list ]Generates a diagonal matix with diagonal elements taken from the list
Dimensions[ list ]Gives the dimensions of the list
MatrixForm[ list ]Shows the list  in a matrix form.
 
c m     or     c*mMultiplies a constant  c  by the matrix  m
a  .  b Multiplies the matrices   a  and  b  
Inverse[ m ]Inverses the matrix  m   if possible  
MatrixPower[ m, n ] Evaluates the  n-th  matrix  power of the matrix  m  
Det[ m ]Evaluates the determinant of the square matrix  m
Transpose[ m ]Obtains the transpose matrix of  m
Eigenvalues[ m ]Gives a list of the eigenvalues of the square matrix  m  
Eigenvalues[m , k]Gives the list of the first k eigenvalues of m
Eigenvalues[ N [m] ] Calculates numerically the eigenvalues of the square matrix  m
Eigenvectors[ m ] Gives a list of the eigenvectors of the square matrix  m
Eigenvectors[ N[ m ] ]Calculates numerically the eigenvectors of  m.   
 
Apply [ Plus, списък ]  or  Plus @@ list  Evaluates the total sum of all elements in list  
Apply [ Times, list ]  or  Times @@ list  Evaluates the total product of all elements in list .