Recitation 1 Solution

Recitation 1 Solution - x n at n = 1 to be zero 3 Plot the...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
ECEN 314: Signals and Systems Solutions to Recitation 1 1. Let x = [1 2 3 4 5 6] and y = [7 8 9 10 11 12] be two vectors. Write a one line command to find the sum of the product of the first three elements in x and that of the last three elements in y . Solution: sum(x(1:3).*y(4:6)) 2. Let x [ n ] be a discrete-time signal such that x [ n ] = 2 , n = 0 , 1 , n = 2 , - 1 , n = 3 , 3 , n = 4 , 0 , otherwise . Use MATLAB to plot x [ n ]. Make sure that your plot covers all the nonzero values of x [ n ]. Solution: n=0:5; x=[2 0 1 -1 3 0]; stem(n,x); Note that we need to explicitly specify the value of x [
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: x [ n ] at n = 1 to be zero. 3. Plot the following signals (a) y 1 [ n ] = x [ n ] + 2. Solution: n1=n; y1=x+2; stem(n1,y1); % Note that x and n are defined in problem 2 (b) y 2 [ n ] = 3 x [ n ]. Solution: n2=n; y2=3*x; stem(n2,y2); (c) y 3 [ n ] =-x [ n ]. Solution: n3=n; y3=-x; stem(n3,y3); (d) y 4 [ n ] = x [ n + 1]. Solution: n4=-1:4; y4=x; stem(n4,y4); (e) y 5 [ n ] = x [-n ]. 1 Solution: n5=-n; y5=x; stem(n5,y5); (f) y 6 [ n ] = x [2 n ]. Solution: n6=0:2; y6=x(1:2:end); stem(n6,y6); 2...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern