Search for question
Question

Part 2: MATLAB Question (5 Points) Problem 5 (5 Points, 5 Points) Write a MATLAB code to compute the z-transform of any finite sequence using the following steps: 1. Your code should ask the user to determine the lower and upper bounds of the sample vector, that is n₁ <n<n₂. (0.5 Point) 2. Your code should ask the user to determine the finite sequence a[n]. (0.5 Point) 3. Your code should determine the z-transform of the inputted sequence a[n] using the def- inition of z-transform (2 Point) X(z) = x[n] 12=-0 4. Your code should then display the z-transform X(z) to the user. (0.25 Point) Note: You do not need to submit the actual .m file with your answers. • Verify your code with the sequences (r[n] and h[n]) in Problem 3. (1 Point) ⚫ Include your MATLAB code and a demo of results with proper comments in your an- swers. (0.75 Point) Hint: You can use input () command to request an input from user. Hint: You can use disp () command to display the results in the command window. Hint: You may use a for loop to calculate the z-transform using the definition.

Fig: 1