Previous Up Next

6.47.3  Faire une matrice avec une fonction : makemat

makemat a trois arguments :

makemat renvoie la matrice de coefficients aj,k (j=0..n−1 et k=0..p−1) de dimension n × p.
On tape :

makemat((j,k)->j+k,4,3)

ou on tape pour définir la fonction h :

h(j,k):=j+k

puis, on tape :

makemat(h,4,3)

On obtient :

[[0,1,2],[1,2,3],[2,3,4],[3,4,5]]

Attention ! à la dimension et aux indices qui partent de 0 quelquesoit le mode choisi.


Previous Up Next