How to combine multiple curve fits in one plot?

172 vues (au cours des 30 derniers jours)
Hüsamettin Taysi
Hüsamettin Taysi le 25 Mar 2021
Commenté : Matt J le 24 Fév 2023
Hi, this is my first study in Matlab. I have used "cftool" function, and have plotted these two figures. "x", which is "VarName1" is same for both. What I want to do is combine these two figures in one plot. x axis will be same, y axis will extend to maximum y value. Briefly, I want to see all points and their fits in one graph. What am I supposed to do?
Thanks in advance.

Réponses (2)

Matt J
Matt J le 17 Mar 2022
Modifié(e) : Matt J le 17 Mar 2022
Use the cftool to export each fit to a workspace variable cfit1 and cfit2. Then
plot(cfit1,Varname1,y); hold on
plot(cfit2,Varname1,y1); hold off
  3 commentaires
Carlos Eduardo Correia Gatell
This worked perfectly for me. Thank you.
Matt J
Matt J le 24 Fév 2023
@Carlos Eduardo Correia Gatell I'm glad it worked, but if so, please Accept-click the Answer.

Connectez-vous pour commenter.


Daniel Pollard
Daniel Pollard le 25 Mar 2021
This was literally the top result when I googled "plot multiple graphs matlab". For future reference:
  1 commentaire
Esra Ilhan
Esra Ilhan le 17 Mar 2022
This link does not necessarly show how to create the plots in the same figure with Curve fitting option ;)

Connectez-vous pour commenter.

Catégories

En savoir plus sur Get Started with Curve Fitting Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by