How to save and use the slope of fitted line in linear curve fitting as a variable in matlab?
조회 수: 5 (최근 30일)
이전 댓글 표시
Hello How to save and use the slope of fitted line in linear curve fitting as a variable in matlab?
댓글 수: 0
답변 (1개)
Star Strider
2017년 11월 10일
If you are referring to the line produced by the lsline function, this works:
figure(1)
scatter(1:10, rand(1, 10))
hl = lsline;
B = [ones(size(hl.XData(:))), hl.XData(:)]\hl.YData(:);
Slope = B(2)
Intercept = B(1)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with Curve Fitting Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!