How to display the value of output on plot?

404 visualizaciones (últimos 30 días)
Heya :)
Heya :) el 22 de Oct. de 2020
Comentada: KSSV el 22 de Oct. de 2020
My output is Error_x. Is their any way that MATLAB displays the value of output on plot? Like thethe R^2 In the given imagee.
Error_x(count)=sqrt(error)/sqrt(DN);
end
figure
hold on
plot(Error_x,'s-r')

Respuestas (2)

KSSV
KSSV el 22 de Oct. de 2020
Editada: KSSV el 22 de Oct. de 2020
Read about text. With this function, you can specify the string str by providing location (x,y). At this position (x,y) you can display a string str.
  5 comentarios
Heya :)
Heya :) el 22 de Oct. de 2020
Like the R^2 in the figure given below.
KSSV
KSSV el 22 de Oct. de 2020
With the data in hand ..you can find R^2 and you can use text or annotate. Also after plotting you can go to edit and insert a text box manually.

Iniciar sesión para comentar.


Walter Roberson
Walter Roberson el 22 de Oct. de 2020
You can use text() or you can use annotate() . I would suggest that text() is much easier to use for this purpose.
You could also build the value into the title() of the plot, of course.
Your output appears to be a vector, so it is not immediately clear what output you want to display.
  1 comentario
Heya :)
Heya :) el 22 de Oct. de 2020
Yes my output is a vector. Will it display the value if we don't give the value of output outselves. I mean will it display the value of outpit automatically on the plot?

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by