필터 지우기
필터 지우기

draw two curves in matlab

조회 수: 1 (최근 30일)
Lilian Lilian
Lilian Lilian 2022년 3월 6일
편집: HWIK 2022년 3월 6일
I want to draw two curves in matlab , using this code,
In this curve I want x=0, 25, 50,75, .... but not 0, 20, 40,60
help me plz
x=[0:25:200];
y1= [0.4 0.29 0.21 0.19 0.13 0.11 0.09 0.05 0.006];
y2= [0.45 0.27 0.231 0.202 0.12 0.13 0.11 0.062 0.0062];
plot(x,y1,x,y2)

답변 (1개)

HWIK
HWIK 2022년 3월 6일
Try this:
x=[0:25:200];
y1= [0.4 0.29 0.21 0.19 0.13 0.11 0.09 0.05 0.006];
y2= [0.45 0.27 0.231 0.202 0.12 0.13 0.11 0.062 0.0062];
plot(x,y1,x,y2)
xticks(x)
  댓글 수: 2
Lilian Lilian
Lilian Lilian 2022년 3월 6일
Undefined function or variable 'xticks'.
Error in dessiner (line 4)
xticks(x)
HWIK
HWIK 2022년 3월 6일
편집: HWIK 2022년 3월 6일
Maybe you are using an older Matlab version, as it was introduced relatively recently, you can still do this though:
x=[0:25:200];
y1= [0.4 0.29 0.21 0.19 0.13 0.11 0.09 0.05 0.006];
y2= [0.45 0.27 0.231 0.202 0.12 0.13 0.11 0.062 0.0062];
plot(x,y1,x,y2)
set(gca,'XTick',x)

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by