Main Content

vander

Vandermonde matrix

Description

example

A = vander(v) returns the Vandermonde Matrix such that its columns are powers of the vector v.

Examples

collapse all

Use the colon operator to create vector v. Find the Vandermonde matrix for v.

v = 1:.5:3
v = 1×5

    1.0000    1.5000    2.0000    2.5000    3.0000

A = vander(v)
A = 5×5

    1.0000    1.0000    1.0000    1.0000    1.0000
    5.0625    3.3750    2.2500    1.5000    1.0000
   16.0000    8.0000    4.0000    2.0000    1.0000
   39.0625   15.6250    6.2500    2.5000    1.0000
   81.0000   27.0000    9.0000    3.0000    1.0000

Find the alternate form of the Vandermonde matrix using fliplr.

A = fliplr(vander(v))
A = 5×5

    1.0000    1.0000    1.0000    1.0000    1.0000
    1.0000    1.5000    2.2500    3.3750    5.0625
    1.0000    2.0000    4.0000    8.0000   16.0000
    1.0000    2.5000    6.2500   15.6250   39.0625
    1.0000    3.0000    9.0000   27.0000   81.0000

Input Arguments

collapse all

Input, specified as a numeric vector.

Data Types: single | double
Complex Number Support: Yes

More About

collapse all

Vandermonde Matrix

For input vector v=[v1v2vN], the Vandermonde matrix is

[v1N1v11v10v2N1v21v20vNN1vN1vN0]

The matrix is described by the formula A(i,j)=v(i)(Nj) such that its columns are powers of the vector v.

An alternate form of the Vandermonde matrix flips the matrix along the vertical axis, as shown. Use fliplr(vander(v)) to return this form.

[v10v11v1N1v20v21v2N1vN0vN1vNN1]

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

GPU Code Generation
Generate CUDA® code for NVIDIA® GPUs using GPU Coder™.

Version History

Introduced before R2006a