Write a well-documented MATLAB program that plots the damped sinusoid etsin(2t)
ID: 637780 • Letter: W
Question
Write a well-documented MATLAB program that plots the damped sinusoid etsin(2t) over time, over the range of 0 to 10 seconds at a 10ms increment. Use the vectorizing command of the form t - tstart: ting: tend to allocate the time vector, followed by a semicolon to suppress the vector. Construct the damped sinusoid by forming an exponential vector of the form e-t/ followed by a sinusoid vector of the form sin(2tt) Plot your result using the plot command (Your plot will only be the damped plot). Make sure that the time vector t is the same length as the damped sinusoid. Label the x and y axis. Add a title to your graph. Submit your program into a program dampedSinusoid.m. Save your plot to a file labeled 'dampSine.fig', with the savefig command Hint: Use the element-by-element multiplication operator in your solution Damped Sinusoid Plot sine exp damp 0.8 0.6 0.4 0.2 -0.2 -0.4 0.6 -0.8 4 7 9 time IseclExplanation / Answer
Type the follwoing in a new script window:
----
t=[0:0.01:10];
exp_array=exp(-0.5*t);
sinusoid_array=sin(2*pi*t);
y=exp_array.*sinusoid_array;
figure
plot(t,y)
xlabel('time[sec]')
ylabel('Amplitude[v]')
title('Damped Sinusoid Plot')
grid on
savefig('dampSine.fig')
------
SAVE THE SCRIPT BY Ctrl + S and name as : dampedSinusoid and Run it. It will save the figure automatically and display as well.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.