problem regarding plotting cuvres

I am supposed to plot 3 curves on the same figure, The first plot is ok( the red one ), but the other 2 I am getting 2 separated curves for each plot..is there any idea to help me solve this problem?
Thanks in advance.

4 comentarios

Torsten
Torsten el 15 de Abr. de 2022
It seems the x-coordinates are not arranged in an increasing order.
SSBGH
SSBGH el 15 de Abr. de 2022
how can i arrange them in an increasing order?
Walter Roberson
Walter Roberson el 15 de Abr. de 2022
How are you calculating the positions? Are you possibly using roots() or solve() or vpasolve() ?
SSBGH
SSBGH el 15 de Abr. de 2022
im just plotting 3 curves of a differential equation using 2 different approximation methods

Iniciar sesión para comentar.

 Respuesta aceptada

Torsten
Torsten el 15 de Abr. de 2022
Editada: Torsten el 15 de Abr. de 2022
Insead of using
plot(x,y)
try
[sorted_x,I] = sort(x);
sorted_y = y(I);
plot(sorted_x,sorted_y)
for the green and blue curves.

Más respuestas (0)

Categorías

Más información sobre Get Started with Curve Fitting Toolbox en Centro de ayuda y File Exchange.

Preguntada:

el 15 de Abr. de 2022

Comentada:

el 15 de Abr. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by