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 件のコメント

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

サインインしてコメントする。

 採用された回答

Torsten
Torsten 2022 年 4 月 15 日
編集済み: Torsten 2022 年 4 月 15 日

0 投票

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 件のコメント

SSBGH
SSBGH 2022 年 4 月 15 日
thanks alot it worked

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeGet Started with Curve Fitting Toolbox についてさらに検索

質問済み:

2022 年 4 月 15 日

コメント済み:

2022 年 4 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by