필터 지우기
필터 지우기

How to plot a function graphically

조회 수: 1 (최근 30일)
Pouyan Msgn
Pouyan Msgn 2021년 8월 14일
댓글: Matt J 2021년 8월 14일
I have an equation :
that I'd like to plot it. I have a graphical solution:
I will reproduce the plot where = 1/2pi (The orange curve).
I tried but I dont get the same plot:
clc
clear all
PEP0=-0.75:0.1:1.7;
n=1;
v=[],
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
Matt J
Matt J 2021년 8월 14일
Pouyan Msgn 9 minutes ago
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 ?

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

답변 (1개)

Matt J
Matt J 2021년 8월 14일
편집: Matt J 2021년 8월 14일
n=1;
fimplicit(@(x,y) y-x+(1/(2*pi))*sin(2*pi*(n-y)))
xlim([-0.5,1.5])
ylim([-0.2,1.2])

카테고리

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