How to combine multiple curve fits in one plot?
65 次查看(过去 30 天)
显示 更早的评论
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.![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/562348/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/562348/image.png)
0 个评论
回答(2 个)
Matt J
2022-3-17
编辑:Matt J
2022-3-17
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 个评论
Matt J
2023-2-24
@Carlos Eduardo Correia Gatell I'm glad it worked, but if so, please Accept-click the Answer.
Daniel Pollard
2021-3-25
This was literally the top result when I googled "plot multiple graphs matlab". For future reference:
1 个评论
Esra Ilhan
2022-3-17
This link does not necessarly show how to create the plots in the same figure with Curve fitting option ;)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interpolation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!