Generates a Vandermonde matrix.
VANDER(c, n)
c |
- |
A series, the base of the Vandermonde matrix. |
n |
- |
Optional. An integer, the degree. Defaults to length(c). |
An array, a Vandermonde matrix.
c = {1, 2, 3, 4};
v = vander(c);
v == {{ 1, 1, 1, 1},
{ 8, 4, 2, 1},
{27, 9, 3, 1},
{64, 16, 4, 1}}
The second to last column of v is identical to c.
c = {1, 2, 3, 4};
v = vander(c, 3);
v == {{ 1, 1, 1},
{ 4, 2, 1},
{ 9, 3, 1},
{16, 4, 1}}
A third degree Vandermonde matrix is returned where the result is the same as the last 3 columns of the full Vandermonde matrix.
For column c, a square Vandermonde matrix takes the form:
c[1]n-1 ... c[1]3 c[1]2 c[1] 1
c[2]n-2 ... c[2]2 c[2]2 c[2] 1
c[3]n-3 ... c[3]3 c[3]2 c[3] 1
. . . . . .
. . . . . .
. . . . . .
c[n]n-1 ... c[n]3 c[n]2 c[n] 1
If the degree n is not specified, a square Vandermonde matrix is returned where the degree is set to
If n is specified, a non-square Vandermonde matrix of size