could you help me to write this formula in matlap ,and to get it's code ??
조회 수: 9 (최근 30일)
이전 댓글 표시

The formula is in the picture.
댓글 수: 0
채택된 답변
ragesh r menon
2014년 3월 30일
편집: ragesh r menon
2014년 3월 30일
clc
close all
clear all
x=1:10;%give your x here
h=0:2:6; %give your h here
m=length(x);
n=length(h);
X=[x,zeros(1,n)];
H=[h,zeros(1,m)];
%convolution
for i=1:n+m-1
Y(i)=0;
for j=1:m
if(i-j+1>0)
Y(i)=Y(i)+X(j)*H(i-j+1);
else
display('error');
end
end
end
stem(Y);
ylabel('Y[n]');
xlabel('n');
댓글 수: 2
ragesh r menon
2014년 3월 30일
You can copy the code to your m file and substitute x and h with your requirements. give x and h as matrices.
추가 답변 (1개)
Roger Stafford
2014년 3월 30일
편집: Walter Roberson
2023년 8월 13일
That's convolution. Look up the documentation for the matlab function 'conv'.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!