<< makematrix_normal Makematrix makematrix_rosser >>

Makematrix >> Makematrix > makematrix_pascal

makematrix_pascal

Returns the Pascal matrix.

Calling Sequence

A = makematrix_pascal ( n )
A = makematrix_pascal ( n , k )

Parameters

n :

a matrix of floating point integers, must be positive

k :

a matrix of floating point integers, k=-1 returns the upper Pascal matrix, k=0 returns the symetric Pascal matrix, k=1 returns the lower triangular Pascal matrix, other values produce an error. Default k=0.

A :

a n-by-n matrix of floating point integers

Description

Returns the Pascal matrix.

The matrix U=makematrix_pascal(n,1) is so that U'*U=S where S=makematrix_pascal(n,0).

Any optional argument equal to the empty matrix [] is replaced by its default value.

The performances of this algorithm have been optimized.

Examples

makematrix_pascal(5) // symetric
makematrix_pascal(5,-1) // upper
makematrix_pascal(5,0) // symetric
makematrix_pascal(5,1) // lower

// Check a famous identity
n = 5;
U = makematrix_pascal(n,-1)
S = makematrix_pascal(n,0)
L = makematrix_pascal(n,1)
L*U - S

Authors

Bibliography

http://bugzilla.scilab.org/show_bug.cgi?id=7670

http://en.wikipedia.org/wiki/Pascal_matrix


Report an issue
<< makematrix_normal Makematrix makematrix_rosser >>