How to make this code without using built-in convolution function.
Mostrar comentarios más antiguos
clear all;
clc;
delta_t=0.0001;
t=[-6:delta_t:6];
x=(t>=-2)&(t<=2);
h=((t>=0)&(t<=3)).*((2/3)*t);
y=conv(x, h, 'same')*delta_t;
subplot(3,1,1); plot(t,x,'r'); grid on; ylim([-0.5 2]); ylabel('x(t)')
subplot(3,1,2); plot(t,h,'m'); grid on; ylim([-0.5 3]); ylabel('h(t)')
subplot(3,1,3); plot(t,y,'b'); grid on; ylim([-0.5 4]); ylabel('y(t)')
1 comentario
Paul
el 31 de Mzo. de 2024
If you have a license for the Symbolic Math Toolbox, the closed-form expression for y can be obtained using syms, rectangularPulse, and int
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
