필터 지우기
필터 지우기

draw a function in the matlab

조회 수: 3 (최근 30일)
Chris Lin
Chris Lin 2021년 8월 11일
답변: Walter Roberson 2021년 8월 11일
How to draw abs(g(k)) in the matlab when a=0,k=+-2pi or a=0,k=+-6pi

답변 (2개)

Chunru
Chunru 2021년 8월 11일
a=0;
k = (-10:1:10)*2*pi;
g = -2*pi./(4*pi^2+(a-k*1i).^2) +2*pi./(4*pi^2+(a+k*1i).^2) -(a-k*1i)./(36*pi^2+(a-k*1i).^2) +...
+ (a+k*1i)./(36*pi^2+(a+ k*1i).^2);
stem(k/(2*pi), abs(g))
xlabel('k/(2\pi)')
  댓글 수: 4
Chris Lin
Chris Lin 2021년 8월 11일
If I have the original code as follows, how can I continue to draw what lg(x)l looks like when a=0,k=+-2pi or a=0,k=+-6pi?Thanks.
syms x a k real
syms f(x)
assume(a>0)
f(x) = sin(2*pi*x) + cos(6*pi*x)
inner = f(x)*exp(-a*abs(x))*exp(-1i*k*x)
g(k) = int(inner, x, -inf, inf)
Chunru
Chunru 2021년 8월 11일
It seems that your integration over infity is not converging (as long as the symbolic math thinks).
syms x a k real
syms f(x)
assume(a>0)
a = 0
a = 0
f(x) = sin(2*pi*x) + cos(6*pi*x)
f(x) = 
inner = f(x)*exp(-a*abs(x))*exp(-1i*k*x)
inner = 
g(k) = int(inner, x, -inf, inf)
g(k) = 
kval = (-5:5)*2*pi;
gval = g(kval)
gval = 

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


Walter Roberson
Walter Roberson 2021년 8월 11일
When a = 0 then there is no damping being done on the exp(-i*k*x). We also know that f(x) does not have any damping. Therefore the integral can only converge if exp(-i*k*x) converges to 0, but in order for that to happen, k would have to be a purely imaginary number with negative coefficient, which is not the case.
Therefore you cannot plot this when a is 0.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by