Vandermonde Matrix and an Error Vector

10 ビュー (過去 30 日間)
Joseph Percsy
Joseph Percsy 2013 年 4 月 25 日
format long
n = inputdlg('Please enter a series of numbers seperated by spaces/commas: ')
numbers = str2num(n{1});
X = 0
V = fliplr(vander(numbers))
r_size = size(V,2);
c_size = size(V,1);
B = 1+(r_size./numbers)
X = B/V
Here's what I have so far. I've been running the program with n = 5, 15, 20, and basically I want to implement an a way of calculating an error vector using Error = (X - Dt), where Dt = [1, 1, 0, 0, 0, . . . , 0]T.
I'm not really quite sure how to go about this, and is this a good way to solve VX = B for X? Cheers for any advice guys.

回答 (2 件)

bym
bym 2013 年 4 月 25 日
  2 件のコメント
Joseph Percsy
Joseph Percsy 2013 年 4 月 25 日
No, the system is X = B/V. That's not going to change.
Matt J
Matt J 2013 年 4 月 25 日
That's not what you posted. You posted that you wanted to solve V*X=B. The solution for that will be
X=V\B

サインインしてコメントする。


Matt J
Matt J 2013 年 4 月 25 日
編集済み: Matt J 2013 年 4 月 25 日
Why not just use POLYFIT?
X=polyfit(numbers,B,length(B)-1);
It is more numerically stable than using the Vandermonde matrix directly.
I want to implement an a way of calculating an error vector using Error = (X - Dt), where Dt = [1, 1, 0, 0, 0, . . . , 0]T.
I don't really understand where Dt comes from, but why not implement it directly as you've written it?
Dt=[1 1, zeros(1,length(X)-2)].';
Error=X-Dt;

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by