|
||
Example 5.5 To produce a matrix of any dimensiondiagMatrix := proc(n) local row, column; begin A := matrix(n,n); for row from 1 to n do for column from 1 to n do if row=column then A[row,column] := 1 end; if row>column then A[row,column] := 1/(row*column) end; if row<column then A[row,column] := 0 end end; end; return(A) end: diagMatrix(10)
|
||