draw two curves in matlab
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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)
0 Kommentare
Antworten (1)
HWIK
am 6 Mär. 2022
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 Kommentare
HWIK
am 6 Mär. 2022
Bearbeitet: HWIK
am 6 Mär. 2022
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)
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!