How do i put this in Matlab?

4 views (last 30 days)
Abdul Basir Fathillah
Abdul Basir Fathillah on 25 Apr 2021
Hi, i'm just learning this and was wondering how do i put the following in matlab?
𝑥𝑎(𝑡) =𝑒^−500|𝑡|
i understant that i can put x=exp(-500) but how about the |t|?
Thank you very much in advance

Answers (1)

Scott MacKenzie
Scott MacKenzie on 25 Apr 2021
exp(-500*abs(t))
  1 Comment
Abdul Basir Fathillah
Abdul Basir Fathillah on 25 Apr 2021
Thank you. then how do i plot it's fourier transform?
Is this way correct?
Fs = 1000;
dt = 1/Fs;% sampling interval in time
t = 0:dt:10;% time from 0s to 10s
x = exp(-500*abs(t));% signal in time domain
%x=exp(-t).*cos(100*t)
F = 0.01*fft(x); %signal in frequency domain
figure(1)
plot (abs(F));

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!