Get access to the MATLAB software package. Read the MATLAB appendices M1.1 M1.3
ID: 3663895 • Letter: G
Question
Get access to the MATLAB software package. Read the MATLAB appendices M1.1 M1.3 at the end of Chapter 1 of your text. Perform the following tasks: Plot the following functions: sin(2t), sin(2(t - 1/2)) and sin(2(t + 1/3)) over the interval [0,5] on a single graph. Plot the following functions: u(t), u(t - 1), u(t) - u(t - 1) and u(2t) - u(2t - 1), each over the interval [0,2]. Remark: Always present your simulations results in a clear, concise and professional manner. This means: Provide the source code. Title all plots and label all axes on all plots. If more than one plot is on a single graph, supply a legend. Explain your results. Is it what you expect If not, why not An unintelligible presentation will simply not be graded at all and result in zero credit.Explanation / Answer
t = 0:0.1:5; % [0,5] interval
y1 = sin(2*t);
y2 = sin(2*(t-1/2));
y3 = sin(2*(t+1/3));
figure
plot(t,y1,'r',t,y2,'b',t,y3,'g')
title('Graph of Sine functions')
legend('sin(2t)','sin(2(t-1/2))','sin(2(t+1/3)','Location','northoutside')
xlabel('0 < t < 5') % x-axis label
ylabel('Sine values') % y-axis label
x = 0:0.1:2; % [0,2] interval
y4 = heaviside(x); % u(t)
y5 = heaviside(x-1); % u(t-1);
y6 = heaviside(x) - heaviside(x-1); %u(t) - u(t-1)
y7 = heaviside(2*x) - heaviside(2*x -1); %u(2t) - u(2t-1)
figure
plot(x,y4)
title('Graph of u(t)')
xlabel('0 < t < 2') % x-axis label
ylabel('u(t)') % y-axis label
figure
plot(x,y5)
title('Graph of u(t-1)')
xlabel('0 < t < 2') % x-axis label
ylabel('u(t-1)') % y-axis label
figure
plot(x,y6)
title('Graph of u(t) - u(t-1)')
xlabel('0 < t < 2') % x-axis label
ylabel('u(t) - u(t-1)') % y-axis label
figure
plot(x,y7)
title('Graph of u(2t) - u(2t-1)')
xlabel('0 < t < 2') % x-axis label
ylabel('u(2t) - u(2t-1)') % y-axis label
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.