Finding a trendline from a scatter plot

128 ビュー (過去 30 日間)
Benjamin
Benjamin 2019 年 12 月 9 日
回答済み: ME 2019 年 12 月 9 日
Hello
Dear All
I need to find a trendline for a scatter plot(s) in Matlab. Unfortunately, my scatter plot(s) does not show a nice trend, or relationship between between my X's and Y. I want to know if Matlab is able to give me the best possible trendline that can be fit for that scatter plot or at least I try to fit different types of curves. Excel is able to fit a trendline (Liner, Logarithmic, Polynomial, and etc) having any scatter plot, but it seems Matlab cannot do that--at least using polyfit(X,Y,n) having n=1,2,...
attached is one of my scatter plots picture.
Thank you

採用された回答

ME
ME 2019 年 12 月 9 日
MATLAB can do this if you make your scatter plot and then in the figure window go to "Tools -> Basic Fitting". That will then allow you to draw a bunch of different data fits onto your diagram, output the residuals, output the formulae, etc.
I'm sure there is probably a way to call this all programatically but I don't know of it.
I know there are also fitting tools in some of the MATLAB licensed toolboxes, but I don't currently have access to any of those so I can't really be much help on those.
Perhaps somebody else might be able to help with the gaps here!

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with Curve Fitting Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by