I am pretty new on MATLAB and want to plot an exponentially sinusoidal signal Can someone help me. Thank you.

1 view (last 30 days)
x(t) = 20sin(2000πt − π/3)e^-at where the values of a = 500,750,1000 with x(t) -2<t<2.

Accepted Answer

Image Analyst
Image Analyst on 13 Oct 2014
Try this:
t = linspace(-2, 2, 400);
for a = [500,750,1000]
x = 20*sin(2000 * pi* t - pi/3) .* exp(-a*t);
plot(t, x, 'b-');
hold on;
end
grid on;
% Enlarge figure to full screen.
set(gcf, 'Units', 'Normalized', 'Outerposition', [0, 0, 1, 1]);
Of course those are some pretty big attenuations and it drops to zero almost immediately.
  2 Comments
limm10
limm10 on 13 Oct 2014
Thank you a lot, here i want to ask some few question to understand better. You add 400 to linspace (-2,2,400). What is it exactly for? And also in plot, you add 'b-'. What it functions while ploting?
Image Analyst
Image Analyst on 13 Oct 2014
That says that there will be 400 data points in between -2 and 2. If you just did t = -2:2 then the only values you will get are -2,-1,0,1,and 2, which is not enough to see how this curve behaves everywhere.
b means plot in blue color. - means put a solid line between all the data points. See help on plot() for other plot options. You can make it look any appearance you'd like with the proper options.

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!