How do I create an arbitrary polynomial with defined coefficient in vector form?
古いコメントを表示
Hello! How do I create an arbitrary polynomial if we got the coefficients and the extent of the polynomial? We have the coefficients in a vector and the extent of the polynomial is a number. So we are unsure how to combine these two and to have a variable x (for example how do I write y = 2x + 5 if I have the coefficient [2 5]' and the extent is one?).
And we are doing this in MATLAB.
回答 (1 件)
dpb
2015 年 12 月 3 日
One way is
b= [2 5].';
x=1;
y=polyval(b,x);
4 件のコメント
Daniel Brun
2015 年 12 月 3 日
Torsten
2015 年 12 月 3 日
Daniel Brun
2015 年 12 月 3 日
dpb
2015 年 12 月 3 日
So, please Accept the answer...
I'll note it seems as if one should be able to use the Curve Fitting Toolbox cfit object, but it doesn't seem possible to load it with coefficients, only with data.
カテゴリ
ヘルプ センター および File Exchange で Polynomials についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!