Finding Unknown X from Known Y with cftool
古いコメントを表示
Hello all,
Very very new matlab user here. I seem to be able to muddle my way around the software and I have the curve fit toolbox. I have gone through the help activities and seem to be stumped on what to do after I have fit a curve to my data. I do see that an equation for my fit is generated in the results area, but how do I use this in an automated fashion? I was hoping that after generating fit I could somehow enter a Y axis value and have matlab find me the answer (X), withouth having to do it manually. I can't seem to get any of the post processing formulas to give me data that even remoting makes sense. Thanks for your help!
1 件のコメント
the cyclist
2012 年 5 月 25 日
It would be helpful if you gave more details about exactly which MATLAB functions you have used to generate the fit. If you can provide a small code sample as an example, that's the best.
採用された回答
その他の回答 (1 件)
Sean de Wolski
2012 年 5 月 25 日
First: This a good question. +1.
After you're done fitting with the CFTOOL go to "fit">"Save to Workspace". This will then generate an object called fittedmodel (or whatever you choose to name it in the dialog). To use this on other data:
y2 = fittedmodel(x2);
More Small example:
x = 1:10;
y = (1:10)+randn(1,10)+3; %noisy y (nominally: y = x+3)
cftool(x,y)
%Make model and save fitted model
%Now run:
x2 = 10:20;
y2 = fittedmodel(x2);
4 件のコメント
Andrew Wheeler
2012 年 5 月 25 日
Sean de Wolski
2012 年 5 月 25 日
see addendum
Andrew Wheeler
2012 年 5 月 25 日
Sean de Wolski
2012 年 5 月 25 日
Maybe I'm underestimating this, but why don't you just switch the inputs?
カテゴリ
ヘルプ センター および File Exchange で Get Started with Curve Fitting Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!