This document contains MATLAB code to perform the operation y[n]=2x[n-1]+x[n+1]+x[n-2] on the vector x[n]=[1 -2 3 6 -5] and plot the result.
The code first defines x[n], shifts it to obtain x[n-1], x[n+1], and x[n-2], calculates y[n] by summing the shifted vectors weighted according to the equation, and plots both x[n] and y[n] on the same figure with two subplots.
This document contains MATLAB code to perform the operation y[n]=2x[n-1]+x[n+1]+x[n-2] on the vector x[n]=[1 -2 3 6 -5] and plot the result.
The code first defines x[n], shifts it to obtain x[n-1], x[n+1], and x[n-2], calculates y[n] by summing the shifted vectors weighted according to the equation, and plots both x[n] and y[n] on the same figure with two subplots.
Copyright:
Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online from Scribd
This document contains MATLAB code to perform the operation y[n]=2x[n-1]+x[n+1]+x[n-2] on the vector x[n]=[1 -2 3 6 -5] and plot the result.
The code first defines x[n], shifts it to obtain x[n-1], x[n+1], and x[n-2], calculates y[n] by summing the shifted vectors weighted according to the equation, and plots both x[n] and y[n] on the same figure with two subplots.
Copyright:
Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online from Scribd