x = 1:100;
y = ones(1,100);
y1 = ones(1,100);
y2 = ones(1,100);
y3 = ones(1,100);
y = x;
y1 = x+2;
y2 = x+50;
y3 = x+100;
plot(x,y2,x,y3);
figure(1);
xlabel("x");
ylabel("y");
legend('y2,y3');
plot(x,y,x,y1);
figure(2);
xlabel("x");
ylabel("y");
legend1('y,y1');
When I am running figure(2) is coming blank. Why is it so?

 採用された回答

VBBV
VBBV 2020 年 11 月 9 日
編集済み: VBBV 2020 年 11 月 9 日

0 投票

%if true
% code
% end
figure(1)
plot()
...
...
figure(2)
plot()
...
...
Follow this sequence for plotting. There is no legend1. Only legend

1 件のコメント

ANMOL BAKSHI
ANMOL BAKSHI 2020 年 11 月 9 日
yes it worked, thanks a lot.

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

その他の回答 (0 件)

カテゴリ

製品

タグ

質問済み:

2020 年 11 月 9 日

コメント済み:

2020 年 11 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by