Equation of the Line in command window
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Ashley Megow
le 8 Oct 2020
Commenté : Star Strider
le 8 Oct 2020
I have a graph, with an equation, but i need to display that equation into the command window.
0 commentaires
Réponse acceptée
Star Strider
le 8 Oct 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 commentaires
Star Strider
le 8 Oct 2020
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Large Files and Big Data dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!