Equation of the Line in command window
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Ashley Megow
am 8 Okt. 2020
Kommentiert: Star Strider
am 8 Okt. 2020
I have a graph, with an equation, but i need to display that equation into the command window.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/375361/image.jpeg)
0 Kommentare
Akzeptierte Antwort
Star Strider
am 8 Okt. 2020
Try this:
B = [y(:) ones(size(y(:)))] \ x(:);
fprintf('Linear: y = %.4f*x%+.2f', B) % Display In Command Window
text(0, max(ylim), sprintf('Linear: y = %.4f*x%+.2f', B), 'HorizontalAlignment','left', 'VerticalAlignment','top') % Display On Plot
.
4 Kommentare
Star Strider
am 8 Okt. 2020
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Large Files and Big Data finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!