Curve fitting multiple lots of data within the same gscatter graph?
2 ビュー (過去 30 日間)
古いコメントを表示
Hello, I am trying to find and graph the curve fitting for each of the four classes of data in each graph. The tables of the graph are created from two 1x12 tables with a corresponding value which is referenced in the legend. I've attached an image to the question in order to be as precise as I can be with this request. All help is appreciated and if need be, I'd be happy to explain further.

2 件のコメント
Rohit Kulkarni
2022 年 7 月 2 日
Do you want to find a fitting curve for each single class or you want to do mutli-class classification?
回答 (1 件)
sai charan sampara
2023 年 10 月 12 日
Hello Evan,
I understand that you are trying to fit curves to multiple categories of data plotted in a single scatter plot.
There are multiple functions to do curve fitting in MATLAB. Some of them include “polyfit”, “fitlm” and “lsqcurvefit”. For fitting data of multiple categories, the data can be first joined into a single table and then divided into sub parts based on their categories. This can be done by logical indexing. Then each data can be curve fitted and then plotted onto the same graph by using “hold on”.
You can refer to the below documentation to learn more.
- “polyfit”: https://www.mathworks.com/help/matlab/ref/polyfit.html
- “fitlm”: https://www.mathworks.com/help/stats/fitlm.html
- “lsqcurvefit”: https://www.mathworks.com/help/optim/ug/lsqcurvefit.html
- Logical indexing: https://www.mathworks.com/help/matlab/math/array-indexing.html#:~:text=col%20%3D%202-,Indexing%20with%20Logical%20Values,-Using%20true%20and
Hope this helps.
Thanks,
Charan.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Curve Fitting Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!