How to display equation of the line in the figure?

7 次查看(过去 30 天)
I need to indicate the corresponding equations of the lines within the figure. How to do this? Please look at the attached file.

回答(2 个)

GILBERT ALVIOLA
GILBERT ALVIOLA 2017-7-24
编辑:Walter Roberson 2017-7-24
txt1 = ['y = (' num2str(m) ')x + (' num2str(a) ')'];
text(x, y, txt1);
  2 个评论
Leela Sai Krishna
Leela Sai Krishna 2019-5-20
编辑:Leela Sai Krishna 2019-5-20
It works. Thanks for your response.
This text is added along the fitline. how to add this text at topleft.
Thanks in advance

请先登录,再进行评论。


Walter Roberson
Walter Roberson 2013-10-4
text() the equation into place if you need to have the equation show up in the main figure axis.
Consider instead using legend()

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by