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!