Plotting in a specific range

조회 수: 2 (최근 30일)
ILAYDA GULSEN KOCAK
ILAYDA GULSEN KOCAK 2021년 5월 24일
댓글: ILAYDA GULSEN KOCAK 2021년 5월 25일
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 CenterFile Exchange에서 2-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