next up previous contents index
suivant: Define a matrix : monter: Arithmetic and matrix précédent: Make a matrix from   Table des matières   Index


Build a matrix with a function : makemat

makemat takes three arguments : makemat returns the matrix A = (aj, k) (j = 0..n - 1 and k = 0..p - 1) of dimension n×p.
Input :
makemat((j,k)->j+k,4,3)
or first define the h function:
h(j,k):=j+k
then, input:
makemat(h,4,3)
Output :
[[0,1,2],[1,2,3],[2,3,4],[3,4,5]]
Note that the indices are counted starting from 0.



giac documentation written by Renée De Graeve and Bernard Parisse