how to do linear line in GUI
이전 댓글 표시
i want to insert linear line like the first picture and if possible the equation of y intercept too.
second picture is the command for the GUI window and the last pic is the current graph

댓글 수: 3
Walter Roberson
2020년 12월 27일
sy w
2021년 1월 3일
Walter Roberson
2021년 1월 4일
You can record the handle of the refline() and set the LineStyle property to '--' to get the broken line.
답변 (1개)
Cris LaPierre
2021년 1월 4일
편집: Cris LaPierre
2021년 1월 4일
1 개 추천
You would do it the same way you would in MATLAB.
Incidentally, either approach will return you the slope (m) and intercept (b), which you can use with refline. If you want the fit line to extend beyond the data, create an X vector that covers the range of values you would like, and use your equation to compute the corresponding Y values.
카테고리
도움말 센터 및 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!