Could you please show all the steps clearly and specific Question 3. Thank you!!
ID: 3872131 • Letter: C
Question
Could you please show all the steps clearly and specific Question 3. Thank you!!
For all the questions below, use a time resolution of 1ms for your time axis: t [-2:0.001:2]. Remember your script should be self-sufficient. The answers to the questions below should be displayed one after the other after each key stroke as we discussed in the Matlab tutorial video!! Question 1 (40 points). Plot the following signals using Matlab. Label the signals as a(t), b(t), ct), and d(t). When you run your script, it should automatically plot all four signals in a single figure window with properly labeled)and (y) axis-as shown below b(t) c(t) d(t) Question 2 (20 points). Use Matlab to calculate the energy of the signals a(t), b(t), c(t) and d(t) you plotted as part of Question 1. Label signal energies as a_energy, b energy, etc. When you run your script, it should automatically calculate and display energies of the signals a, b, c and d one at a time with each key stroke. Question 3 (40 points). Plot the following time modified versions of the signals in question 1. Matlab should display a single plot for each part of this question with each key stroke. a. a(t/2+1) b. -b(-t-1) C. C(-2t+4)-1 d. dt+2)+1 When you run your script, it should automatically plot each signal in a single figure window with properly labeled (x) and (y) axis -and should proceed to next plot when you press any keyExplanation / Answer
%Assuming the x axis range from -3 to 3 for all graphs
%subpot will help us plot all the four graph in the same window
% Takes parameter (m,n,pos) where m=number of rors, n= no. of column, pos = graph's position
%For four graph, we will have 2 rows and 2 columns
%Position : 1,2,3,4
%Time Plots
% Divide time into 4 parts, -3 to -1, -1 to 0, 0 to 1, 1 to 3
t1 = [-3:0.5:-1];
t2 = [-1:0.5:0];
t3 = [0:0.5:1];
t4 = [1:0.5:3];
%combine all the time range
t=[t1,t2,t3,t4]
%Plot function for a(t) in the divided time range
a_t1 = 0;
a_t2 = 1+t2;
a_t3 = 1-t3;
a_t4 = 0;
%combine all the signal graphs
a_t = [a_t1,a_t2,a_t3,a_t4];
%First graph : Postion = 1
subplot(2,2,1)
plot(t,a_t),axis([-3 3 -2 2])
%Plot function for b(t) in the divided time range
b_t1 = 0;
b_t2 = 1;
b_t3 = 1;
b_t4 = 0;
%combine all the signal graphs
b_t = [b_t1,b_t2,b_t3,b_t4];
%Second graph : Postion = 2
subplot(2,2,2)
plot(t,b_t),axis([-3 3 -2 2])
%Plot function for c(t) in the divided time range
c_t1 = 0;
c_t2 = -t2;
c_t3 = t3;
c_t4 = 0;
%combine all the signal graphs
c_t = [c_t1,c_t2,c_t3,c_t4];
%Third graph : Postion = 3
subplot(2,2,3)
plot(t,c_t),axis([-3 3 -2 2])
%Plot function for d(t) in the divided time range
d_t1 = 0;
d_t2 = -1;
d_t3 = 1;
d_t4 = 0;
%combine all the signal graphs
d_t = [d_t1,d_t2,d_t3,d_t4];
%Fourth graph : Postion = 4
subplot(2,2,4)
plot(t,d_t),axis([-3 3 -2 2])