Plotting in a specific range

2 views (last 30 days)
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 Comments
ILAYDA GULSEN KOCAK
ILAYDA GULSEN KOCAK on 25 May 2021
thank you very much , it worked.

Sign in to comment.

Accepted Answer

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

More Answers (0)

Community Treasure Hunt

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

Start Hunting!