Finding the slope of line

454 visualizaciones (últimos 30 días)
Tarkan Canova
Tarkan Canova el 8 de Nov. de 2018
Comentada: Syed Zubair shah el 5 de Abr. de 2022
I have to find slope of best line (acceleration). How can I find it ? I couldn't find any datas about it on the internet.
  1 comentario
Stephen23
Stephen23 el 8 de Nov. de 2018
"How can I find it ?"
By the definition of slope: the change in Y divided by the change in X.

Iniciar sesión para comentar.

Respuesta aceptada

KSSV
KSSV el 8 de Nov. de 2018
If you have points: use slope formula:
m = (y2-y1)/(x2-x1) ;
Or, fit a straight line using polyfit
p = polyfit(x,y,1) ;
In the above p will be a 2x1 matrix, which gives slope and y intercept.
Or, if you have image and want coordinates from there slope use:
  6 comentarios
Navodita Das
Navodita Das el 31 de Mayo de 2020
Ok,I got it. Thank you for helping.
Syed Zubair shah
Syed Zubair shah el 5 de Abr. de 2022
can you share a short code for implementation? of polyfit(x,y,1)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Image Processing Toolbox en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by