Trend lines

13 visualizaciones (últimos 30 días)
Chloe
Chloe el 31 de En. de 2012
Respondida: Chad Greene el 22 de En. de 2015
Hi, I am trying to plot linear trend lines for a number of data sets and determine their respective gradients. Is there any way of doing this without using the 'tools,basic fitting' tab in the figure? Doing this for every plot will be quite time consuming. Sorry, I know this is probably a pretty basic question, but I'm pretty new to Matlab and would really appreciate any help. Thanks Chloe x

Respuesta aceptada

Sean de Wolski
Sean de Wolski el 31 de En. de 2012
Perhaps polyfit() and polyval()?
doc polyfit
doc polyval
  1 comentario
Chloe
Chloe el 31 de En. de 2012
Fab! Thank you :)

Iniciar sesión para comentar.

Más respuestas (1)

Chad Greene
Chad Greene el 22 de En. de 2015
...Or to streamline the polyfit -> polyval -> plot process, polyplot does it all in one step, just like this:
polyplot(x,y)
You can also include any line formatting commands, just as you would with plot. For example,
polyplot(x,y,'r--','linewidth',3)

Categorías

Más información sobre Descriptive Statistics en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by