5 views (last 30 days)

Show older comments

Roger Stafford
on 28 Feb 2018

Edited: Stephen
on 28 Feb 2018

Assume your xi's and yi's are given by a couple of column vectors, x and y of the same length.

n = length(x);

A = [x.^(n-1:-1:0)];

c = A\y;

Roger Stafford
on 28 Feb 2018

If you have an older version of matlab, use

A = bsxfun(@power,x,((n-1):-1:0));

where again I assume x is a column vector.

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!