could you help me to write this formula in matlap ,and to get it's code ??

조회 수: 9 (최근 30일)
The formula is in the picture.

채택된 답변

ragesh r menon
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
Sereena
Sereena 2014년 3월 30일
thank you , but canu teel me how can i get the code ??
ragesh r menon
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
Roger Stafford 2014년 3월 30일
편집: Walter Roberson 2023년 8월 13일
That's convolution. Look up the documentation for the matlab function 'conv'.

카테고리

Help CenterFile Exchange에서 Elementary Math에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by