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)
Show older comments
x(t) = 20sin(2000πt − π/3)e^-at where the values of a = 500,750,1000 with x(t) -2<t<2.
0 Comments
Accepted Answer
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
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.
More Answers (0)
See Also
Categories
Find more on Log Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!