undefined X variable in curve fit

1 回表示 (過去 30 日間)
Gavin Seddon
Gavin Seddon 2015 年 9 月 2 日
回答済み: Gavin Seddon 2015 年 9 月 3 日
hello,
I have returned to the optimisation, I get
f(x) = p1*x^7 + p2*x^6 + p3*x^5 + p4*x^4 + p5*x^3 + p6*x^2 + p7*x + p8
Undefined function or variable 'x'.
how must I redefine X?
Thanks.

採用された回答

Walter Roberson
Walter Roberson 2015 年 9 月 2 日
f = @(x) p1*x^7 + p2*x^6 + p3*x^5 + p4*x^4 + p5*x^3 + p6*x^2 + p7*x + p8

or

f = polyval([p1, p2, p3, p4, p5, p6, p7, p8], x);

その他の回答 (1 件)

Gavin Seddon
Gavin Seddon 2015 年 9 月 3 日
I had tried the 1st, I think it is my installation. Thanks.

カテゴリ

Help Center および File ExchangeCurve Fitting Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by