<< makematrix_toeplitz Makematrix makematrix_wilkinsonm >>

Makematrix >> Makematrix > makematrix_vandermonde

makematrix_vandermonde

Returns the Vandermonde matrix

Calling Sequence

A = makematrix_vandermonde ( x )
A = makematrix_vandermonde ( x , n )

Parameters

x :

a m-by-1 or 1-by-m matrix of doubles

n :

a 1-by-1 matrix of doubles, integer value

A :

a m-by-n matrix of doubles, the Vandermonde matrix of x.

Description

Returns the Vandermonde matrix of size n, made with entries from x.

For i = 1, 2, ..., m and j = 1, 2, ..., n, we have A(i,j) = x(i)^(j-1)

The determinant of Vandermonde's matrix is

Caution: in Matlab, the columns produced by the "vander" function are reversed.

Examples

A = makematrix_vandermonde ( 1:5 )
// Get only the first 3 columns, i.e.
// up to power 2.
A = makematrix_vandermonde ( 1:5 , 3 )

// Compare exact determinant with Scilab's det
n = 5;
x = (1:n)';
A = makematrix_vandermonde ( x )
// Compute exact determinant
d = 1.;
for i = 1: n
for j = i+1: n
d = d * (x(j) - x(i));
end
end
disp([det(A) d])

Authors

Bibliography

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


Report an issue
<< makematrix_toeplitz Makematrix makematrix_wilkinsonm >>