MATLAB Answers

integral of function definite in piece with multiple variable

3 views (last 30 days)
Simo
Simo on 21 May 2020
Answered: Walter Roberson on 21 May 2020
I need to calculate the fourier transform of a function
can you show me how to run this code and also how to run using syms
thank you
clear
r0=@(t) (t<0);
r1=@(t) (t>=0 & t<1);
r2=@(t) (t>=1);
r3=@(t) (t>=1 & t<2);
r4=@(t) (t>=2);
p=@(t) (r0(t).*0+r1(t).*1+r2(t).*0);
P=@(w)(integral(p.*exp(complex(0,-w*t))/sqrt(2*pi),-inf,+inf));

  0 Comments

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 21 May 2020
P = @(w) integral( @(t) p(t) .* exp(complex(0,-w*t))/sqrt(2*pi),-inf,+inf);

  0 Comments

Sign in to comment.

More Answers (0)


Translated by