problem regarding plotting cuvres

1 vue (au cours des 30 derniers jours)
SSBGH
SSBGH le 15 Avr 2022
Commenté : SSBGH le 15 Avr 2022
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 commentaires
Walter Roberson
Walter Roberson le 15 Avr 2022
How are you calculating the positions? Are you possibly using roots() or solve() or vpasolve() ?
SSBGH
SSBGH le 15 Avr 2022
im just plotting 3 curves of a differential equation using 2 different approximation methods

Connectez-vous pour commenter.

Réponse acceptée

Torsten
Torsten le 15 Avr 2022
Modifié(e) : Torsten le 15 Avr 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.
  1 commentaire
SSBGH
SSBGH le 15 Avr 2022
thanks alot it worked

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots 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!

Translated by