How to add two conditions to a plot?

2 ビュー (過去 30 日間)
Padi
Padi 2022 年 12 月 15 日
編集済み: Bora Eryilmaz 2022 年 12 月 15 日
Hello! I am trying to impose two conditions on one plot. Specifically I want to change the color and make it a dashed line.
plot(x,u,x,v,x,AL,"b",x,BE, "r",'LineWidth',2.0), xlabel('x'), axis([0 1 0 1])), legend('u','v','alphaline','betaline'), pause(0.05)
how can I add on the AL and BE plot that I want "b" and '--'?? It keeps giving me an error.
Thanks!
  1 件のコメント
Padi
Padi 2022 年 12 月 15 日
I tried x,AL, "b",'--' and
x,AL,["b", '--'] and they both give me errors.

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

採用された回答

Bora Eryilmaz
Bora Eryilmaz 2022 年 12 月 15 日
編集済み: Bora Eryilmaz 2022 年 12 月 15 日
You had unmatched parentheses among other things.
x = 1:10;
u = rand(1,10);
v = rand(1,10);
AL = rand(1,10);
BE = rand(1,10);
plot(x,u, x,v, x,AL,"b--", x,BE, "r:", 'LineWidth',2.0)
xlabel('x')
% axis([0 1 0 1])
legend('u','v','alphaline','betaline')
  1 件のコメント
Padi
Padi 2022 年 12 月 15 日
Thanks!! :)

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeScatter Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by