Previous Up Next

2.42.24Build 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.


Previous Up Next