What is the output of the following code? [code]>>p=conv([ones(1,100)],[ones(1,100)]); >>x=[1:1:199]; >> plot(x,p)[/code]

What is the output of the following code?
Code:
>>p=conv([ones(1,100)],[ones(1,100)]);
>>x=[1:1:199];
>> plot(x,p)
A. A triangular pulse
B. A step pulse
C. A sinusoid
D. Error
 
Answer: a
Explanation: The convolution of two rectangular pulses will result in a triangular pulse. The input to the conv(0 command are two rectangular pulses. Hence, triangular pulse is correct.
 

Tìm kiếm

Back
Top