Extending a line of best fit with delta
조회 수: 3 (최근 30일)
이전 댓글 표시
I have a datapoint at x=20,40,60,80,100 and I used polyfit to perform a linear fit. Say my polyfit equation is y_fit. In addition, I'm using polyval to find the normr values of the linear fit. From polyval, there's also a delta matrix generated. I'm trying to extend the line of best fit from x = 0 to x = 150 for the plots y_fit-2*delta and y_fit+2*delta from x = 0 to x = 150. What would be the best way to do so
Thanks :)
댓글 수: 1
Adam Danz
2020년 10월 18일
If you use refline() the line will extend across the entire axes.
Otherwise, use the x values (0 and 150) as inputs to your linear function to get the y values. Then use the x and y values to plot a line using plot() or line().
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Interpolation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!