MATLAB Answers

trend line plotting question

8 次查看(过去 30 天)
chin Eng
chin Eng2011-4-3
编辑: Chad Greene ,2021-3-25
Good evening...i have plotting a graph in GUI by loading the data from an excel file! Then, how should i do if i want to add a linear and polynomial trend line in the same axes?
regard chin nyuk eng


Fred 2011-4-3
In GUI after you plot your data, you can drag down "Tools", there is a menu called "Basic Fitting".

更多回答(2 个)

chin Eng
chin Eng 2011-4-3
ya..i know that method. But, is that possible for not using that "tools". I just want to plot a trend line by a click in get my question?
  2 个评论
Samuel 2012-7-6
Some of us prefer code, especially when we need to apply the same code to 10's, if not 100's of files and need the trendlines for all of them. It is very time consuming to have to do that for every file.


Chad Greene
Chad Greene 2021-3-25
I've written a simple function called polyplot to add a linear trend line to plots. Get it on the File Exchange here.

Community Treasure Hunt

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

Start Hunting!

Translated by