Plotting in a specific range

2 visualizzazioni (ultimi 30 giorni)
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 Commenti
Torsten
Torsten il 24 Mag 2021
plot(Res(:,1),Res(:,3))
xlim([21,50])
ILAYDA GULSEN KOCAK
ILAYDA GULSEN KOCAK il 25 Mag 2021
thank you very much , it worked.

Accedi per commentare.

Risposta accettata

Fangjun Jiang
Fangjun Jiang il 24 Mag 2021
index=Res(:,1)>=20;
plot(Res(index,1),Res(index,3))

Più risposte (0)

Categorie

Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by