フィルターのクリア

Curve Fitting Tool Equation Issue

1 回表示 (過去 30 日間)
Leonardo Urbano
Leonardo Urbano 2014 年 4 月 30 日
コメント済み: Image Analyst 2014 年 5 月 6 日
Hi to everybody,
my name is Leo and I am 26. I have an issue regarding the Curve Fitting Toolbox. I have three historical time series, I have performed the fitting and now I have my poly4 normalized curve that approximates to raw input data. My question is: how can I get Fitted Curve Values? I have tried to denormalize data then substitute it to the equation I got but I obtain something like the original time series and not the fitted curve. Any suggestion?
Thank you very much in advance to everyone!
Leo
This is the code I have used to try to get the curve:
%%Denormalizer
% Start...
p1 = .2442;
p2 = -.1398;
p3 = -.2358;
p4 = -2.233;
p5 = 24.05;
for x = SP99(1:252,1)
y = (x - 1327)/57.19;
Curve = p1*y.^4 + p2*y.^3 + p3*y.^2 + p4*y + p5;
end
And this is the curve of I want to obtain values:

採用された回答

Star Strider
Star Strider 2014 年 4 月 30 日
I don‘t have the Curve Fitting Toolbox, but if you have all the fitted parameters and you want to get the values for the curve, one way is to use an anonymous function:
p(1) = .2442;
p(2) = -.1398;
p(3) = -.2358;
p(4) = -2.233;
p(5) = 24.05;
y = (x - 1327)/57.19;
Curve = @(y,p) p(1)*y.^4 + p(2)*y.^3 + p(3)*y.^2 + p(4)*y + p(5);
Then to get the values of Curve for every value of y:
yfit = Curve(y,p)
  4 件のコメント
Star Strider
Star Strider 2014 年 4 月 30 日
編集済み: Star Strider 2014 年 4 月 30 日
If you want to plot the equation for the fitted curve, plot it this way:
plot(y, yfit)
It looks like you‘re simply plotting your original data in the plot you posted in your comment.
Image Analyst
Image Analyst 2014 年 5 月 6 日
Leonardo, attach your code to get SP99, and data file with the paper clip icon.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with Curve Fitting Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by