Finding Unknown X from Known Y with cftool
Afficher commentaires plus anciens
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 commentaire
the cyclist
le 25 Mai 2012
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.
Réponse acceptée
Plus de réponses (1)
Sean de Wolski
le 25 Mai 2012
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 commentaires
Andrew Wheeler
le 25 Mai 2012
Sean de Wolski
le 25 Mai 2012
see addendum
Andrew Wheeler
le 25 Mai 2012
Sean de Wolski
le 25 Mai 2012
Maybe I'm underestimating this, but why don't you just switch the inputs?
Catégories
En savoir plus sur Get Started with Curve Fitting Toolbox dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!