next up previous contents index
suivant: Append a column to monter: Arithmetic and matrix précédent: Build a matrix with   Table des matières   Index


Define a matrix : matrix

matrix takes three arguments : matrix returns the matrix A = (aj, k) (j = 1..n and k = 1..p) of dimension n×p.
Input :
matrix(4,3,(j,k)->j+k)
or first define the h function:
h(j,k):=j+k
then, input:
matrix(4,3,h)
Output :
[[2,3,4],[3,4,5],[4,5,6],[5,6,7]]
Note the argument order and the fact that the indices are counted starting from 1. If the last argument is not provided, it defaults to 0.



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