how to do linear line in GUI
Ältere Kommentare anzeigen
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 Kommentare
Walter Roberson
am 27 Dez. 2020
sy w
am 3 Jan. 2021
Walter Roberson
am 4 Jan. 2021
You can record the handle of the refline() and set the LineStyle property to '--' to get the broken line.
Antworten (1)
Cris LaPierre
am 4 Jan. 2021
Bearbeitet: Cris LaPierre
am 4 Jan. 2021
1 Stimme
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.
Kategorien
Mehr zu Get Started with Curve Fitting Toolbox finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!