<< makematrix_circul Makematrix makematrix_dingdong >>

Makematrix >> Makematrix > makematrix_diagonali

makematrix_diagonali

Returns a diagonal-i matrix

Calling Sequence

A = makematrix_diagonali ( n )

Parameters

n :

a 1-by-1 matrix of doubles, integer value, the size of the matrix to return

A :

a n-by-n matrix of doubles, the Diagonal-i matrix

Description

Returns a matrix of size n with i on the diagonal.

For i=1,2,...,n, we have : A(i,i) = i

Examples

A = makematrix_diagonali ( 5 )

Authors

Bibliography

J.C. Nash, Compact Numerical Methods for Computers: Linear Algebra and Function Minimisation, second edition, Adam Hilger, Bristol, 1990 (Appendix 1).


Report an issue
<< makematrix_circul Makematrix makematrix_dingdong >>