Borrar filtros
Borrar filtros

How the error value appears in the graph?

4 visualizaciones (últimos 30 días)
Momo
Momo el 7 de Mzo. de 2018
Comentada: Momo el 8 de Mzo. de 2018
Hello, I am trying to plot the difference between two polynomials some of graphs I could not get the value of the error on it like the following graph.
so what I can do to make the value of the error appears in the graph?
Error=abs(p1-p2);
  1 comentario
Rik
Rik el 7 de Mzo. de 2018
What is the code that you are using and how exactly to do want the error to be shown?

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 7 de Mzo. de 2018
hold on
plot(x, Error, 'r')
where x is the name of the variable being used for the x axis.
Note that it is possible that the error is small enough that it would not be visible on the graph except as a (red) line against the bottom. For example if the error were about 1E-15 then it would only be 1/10000 the span of your y axes.
  5 comentarios
Walter Roberson
Walter Roberson el 8 de Mzo. de 2018
ax = gca;
ax.YAxis.Exponent = 0;
this would disable using the exponent on the Y axis.
If you use a value other than 0 then that exponent will be used; for example you can use a value of -1 or 1.
However, if you want 10^0 to be specifically marked then you have to use an exponent of 0 and then text() the 10^0 into place.
Momo
Momo el 8 de Mzo. de 2018
Thank you so much

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by