How do I fix my x-axis ?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Ayush Kumar
il 2 Apr 2021
Commentato: Ayush Kumar
il 2 Apr 2021
How do I fix the values on my x-axis to go from 0 to 2?
My intention is to plot y=8*cos(2*π*x) and y=8*cos(19*π*x)*exp(-x)
where where x is from 0 to 2 and y is from -8 to 8.
if any one could give me the correct code it would be much appreciated.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/570429/image.png)
0 Commenti
Risposta accettata
Mathieu NOE
il 2 Apr 2021
hello
here you are :
x = 0:1e-3:2;
y1=8*cos(2*pi*x);
y2=8*cos(19*pi*x).*exp(-x);
figure(1),plot(x,y1,x,y2)
5 Commenti
Mathieu NOE
il 2 Apr 2021
sure
you can do it this way :
x = 0:1e-3:2;
y0=zeros(size(x));
y1=8*cos(2*pi*x);
y2=8*cos(19*pi*x).*exp(-x);
figure(1),plot(x,y0,x,y1,x,y2)
Più risposte (0)
Vedere anche
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!