Info

此问题已关闭。 请重新打开它进行编辑或回答。

Convolution Capabilities in MATLAB

1 次查看(过去 30 天)
Paige Coffeen
Paige Coffeen 2018-3-13
关闭: MATLAB Answer Bot 2021-8-20
Hello!
I have 2 discrete signals that I have entered into MATLAB and successfully gotten a graph of the convolution of the two. I’m wondering if MATLAB is capable of turning this into an output function. Currently I have h(n)=1 for n=0:9 and x(n)=3.*n.*heaviside(-n) both plotted on a stem graph. I also have the convolution as a stem graph, however, I tried getting an equation output from this and have not had any luck.
Below is my code that works as I want minus turning w into a function.
clear all;
close all;
subplot(2,2,1);
n = -9:9;
A = 3.*n.*heaviside(-n);
stem(n,A)
title('Graph of x(n)')
xlabel('n')
ylabel('x(n)')
subplot(2,2,2);
k = 0:9;
for m = 1:numel(k);
H(m) = 1;
end
stem(k,H);
title('Graph of h(n)')
xlabel('n')
ylabel('h(n)')
subplot(2,2,3);
p = 1:28;
w = conv(A,H);
stem(p,w)
title('Graph of y(n): Convolution of h(n) and x(n)')
xlabel('n')
ylabel('y(n)') % code

回答(0 个)

此问题已关闭。

标签

Community Treasure Hunt

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

Start Hunting!

Translated by