vander: MATLAB vander function

Description Usage Arguments Details Value Author(s) Examples

View source: R/vander.R

Description

Generate Vandermonde matrix from a vector of numbers.

Usage

1
vander(v)

Arguments

v

numeric or complex vector of values

Details

Generates the Vandermonde matrix whose columns are powers of the vector v (of length n) using the formula

1
    A[i, j] = v[i]^(n-j)

Used when fitting a polynomial to given points.

Value

Returns an n-by-n matrix constructed as described above.

Author(s)

H. Borchers [email protected]lemail.com, P. Roebuck [email protected]

Examples

1
vander(1:5)

Example output

Attaching package: 'matlab'

The following object is masked from 'package:stats':

    reshape

The following objects are masked from 'package:utils':

    find, fix

The following object is masked from 'package:base':

    sum

     [,1] [,2] [,3] [,4] [,5]
[1,]    1    1    1    1    1
[2,]   16    8    4    2    1
[3,]   81   27    9    3    1
[4,]  256   64   16    4    1
[5,]  625  125   25    5    1

matlab documentation built on May 30, 2017, 6:57 a.m.