Finding a trendline from a scatter plot

108 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Scatter Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by