clc; clear all; close all;x=load('X_In.dat','x');h=load('hn.dat','h');%%conv
for n=1:x y(n)=0; for k=1:n if(n+k-1>0) y(n)=y(n)+hk*h(n-k); else end endendfigure;subplot(3,1,1); stem(x); xlabel('n');ylabel('x[n]'); grid on;subplot(3,1,2); stem(h);xlabel('n'); ylabel('h[n]'); grid on;subplot(3,1,3);stem(y);xlabel('----->n');ylabel('y[n]');grid on;title('HW2_1a713011');
MATLAB: Can some one solved this question, it can’t show the variable y
for loop
Best Answer