Finding the slope of line

조회 수: 471 (최근 30일)
Tarkan Canova
Tarkan Canova 2018년 11월 8일
댓글: Syed Zubair shah 2022년 4월 5일
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
Stephen23
Stephen23 2018년 11월 8일
"How can I find it ?"
By the definition of slope: the change in Y divided by the change in X.

댓글을 달려면 로그인하십시오.

채택된 답변

KSSV
KSSV 2018년 11월 8일
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
Navodita Das
Navodita Das 2020년 5월 31일
Ok,I got it. Thank you for helping.
Syed Zubair shah
Syed Zubair shah 2022년 4월 5일
can you share a short code for implementation? of polyfit(x,y,1)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by