Plotting in a specific range

2 ビュー (過去 30 日間)
ILAYDA GULSEN KOCAK
ILAYDA GULSEN KOCAK 2021 年 5 月 24 日
lets say i have this simple code:
Res=[];
for i=10:2:50
for t=1:1:3
y=i*t
Res=[Res; i t y ]
end
end
How can I plot i-y curve but only when i>20 ?
  2 件のコメント
Torsten
Torsten 2021 年 5 月 24 日
plot(Res(:,1),Res(:,3))
xlim([21,50])
ILAYDA GULSEN KOCAK
ILAYDA GULSEN KOCAK 2021 年 5 月 25 日
thank you very much , it worked.

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

採用された回答

Fangjun Jiang
Fangjun Jiang 2021 年 5 月 24 日
index=Res(:,1)>=20;
plot(Res(index,1),Res(index,3))

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by