could you help me to write this formula in matlap ,and to get it's code ??
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Sereena
el 30 de Mzo. de 2014
Editada: Walter Roberson
el 13 de Ag. de 2023
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/159759/image.bmp)
The formula is in the picture.
0 comentarios
Respuesta aceptada
ragesh r menon
el 30 de Mzo. de 2014
Editada: ragesh r menon
el 30 de Mzo. de 2014
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 comentarios
ragesh r menon
el 30 de Mzo. de 2014
You can copy the code to your m file and substitute x and h with your requirements. give x and h as matrices.
Más respuestas (1)
Roger Stafford
el 30 de Mzo. de 2014
Editada: Walter Roberson
el 13 de Ag. de 2023
That's convolution. Look up the documentation for the matlab function 'conv'.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!