Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

MATLAB please do all of 2, 3, and 4 Plot the signals X_3(t) and x_4(t) in figure

ID: 2079413 • Letter: M

Question

MATLAB please do all of 2, 3, and 4

Plot the signals X_3(t) and x_4(t) in figure P1.2-3 using Matlab Label the signals as x3 and x4 When you run your script, it should automatically plot both signals in a| single figure window with properly labeled (x) and (y) axis. (Remember subplot(.) command.) Use matlab calculate the energy of the signals x_3(t) and X_4(t) that you plotted as part of Question 2. Label signal energies as x3_energy and x4_energy When you run your script it should automatically calculate and display the answer for all 2 signals. Again, For the signal x_4(t) you have plotted for Question 2. plot the following modified signals: x_4(t-3) 2*x_4(t+1) x_4(1-2*t) - 1 (1/2)*x_4(t/1.5) +1 You can label these signals as x4_a. x4_b, x4_c and x4_d. When you run your script, it should automatically plot all four signals in a single figure window with properly labeled (x) and (y) axis. (Remember subplot(.) command.)

Explanation / Answer

Question number 2 and 3

signal x3 with energy code

clc;
part1= @(x) x<-2;
part2= @(x) x>2;
part3= @(x) (x>=0 & x<=2);
part4= @(x) (x<0 & x>=-2);
f= @(x) part1(x).*(0)+part2(x).*(0)+part3(x).*((1/2).*x+1)+part4(x).*((-1/2).*x+1)
x=-4:0.1:4;
k=(f(x)).^2;
m=0;
for i=1:1:81
m=m+k(i);
end
disp(['energy=' num2str(m)]);
plot(x,f(x));

Signal x4 with energy

clc
part1= @(x) x<-2;
part2= @(x) x>2;
part3= @(x) (x>=0 & x<=2);
part4= @(x) (x<0 & x>=-2);
f= @(x) part1(x).*(0)+part2(x).*(0)+part4(x).*((2/3).*x+1)+part3(x).*((-2/3).*x+1)
x=-4:0.1:4;
k=(f(x)).^2;
m=0;
for i=1:1:81
m=m+k(i);
end
disp(['energy=' num2str(m)]);
plot(x,f(x));

Question 4

clc

part1= @(x) x<-2;

part2= @(x) x>2;

part3= @(x) (x>=0 & x<=2);

part4= @(x) (x<0 & x>=-2);

f= @(x) part1(x).*(0)+part2(x).*(0)+part4(x).*((2/3).*x+1)+part3(x).*((-2/3).*x+1)

x=-4:0.1:4;

subplot(4,1,1)

ylabel('x4_a');

plot(x,f(x-3));

subplot(4,1,2)

ylabel('x4_b');

plot(x,2*f(x+1));

subplot(4,1,3)

ylabel('x4_c');

plot(x,f(1-2*x)-1);

subplot(4,1,4)

ylabel('x4_d');

plot(x,(1/2)*f(x/1.5)+1);