How to plot a function graphically
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have an equation :
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/711842/image.png)
that I'd like to plot it. I have a graphical solution:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/711832/image.png)
I will reproduce the plot where
= 1/2pi (The orange curve).
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/711847/image.png)
I tried but I dont get the same plot:
clc
clear all
PEP0=-0.75:0.1:1.7;
n=1;
v=[],
for i=1:length(PEP0)-1
y=-0.2;
v(1)=-0.2;
y=PEP0(i)-(1/(2*pi))*sin(2*pi*(n-y));
v(i+1)=y;
end
plot(PEP0,v','b')
grid on
Could someone please help me with that ?!
1 Commento
Matt J
il 14 Ago 2021
I tried with one another:
clc
clear all
PEP0=-0.24:0.01:1.6;
n=4;
for i=1:length(PEP0)-1
y(1)=-0.36;
y(i+1)=PEP0(i)-(1/(2*pi))*sin(2*pi*(n-y(i)));
end
plot(PEP0,y','b')
grid on
Why dont I get the same plot ?
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!