i need help,i want to calculate the convolution of two discrete time signal but an error has occurred
n=-20:20;
delta=(n>=3 & n<=8);
x=delta;
% x denotes x[n]
delta=(n>=4 & n<=15);
h=delta;
% h denotes h[n]
subplot(3,1,1)
stem(n,x,'filled');
xlabel('n');
ylabel('Amplitude');
title('X[n]');
subplot(3,1,2)
stem(n,h,'filled');
xlabel('n');
ylabel('Amplitude');
title('h[n]');
subplot(3,1,3)
c=conv(x,h);
stem(n,c,'filled');
xlabel('n');
ylabel('Amplitude');
title('y[n]');
help me find the error in the coding...

๋Œ“๊ธ€ ์ˆ˜: 3

John D'Errico
John D'Errico 2016๋…„ 3์›” 27์ผ
What error did you get?
Did you read the help for the conv function? Why not?
Zeeshan Ahmed
Zeeshan Ahmed 2016๋…„ 3์›” 27์ผ
Attempt to execute SCRIPT conv as a function: C:\Users\Zeeshan\Documents\conv.m
Error in Untitled2 (line 19) c=conv(x,h);
above one
Zeeshan Ahmed
Zeeshan Ahmed 2016๋…„ 3์›” 27์ผ
Attempt to execute SCRIPT conv as a function: C:\Users\Zeeshan\Documents\conv.m
Error in Untitled2 (line 19) c=conv(x,h);
above one

๋Œ“๊ธ€์„ ๋‹ฌ๋ ค๋ฉด ๋กœ๊ทธ์ธํ•˜์‹ญ์‹œ์˜ค.

 ์ฑ„ํƒ๋œ ๋‹ต๋ณ€

Image Analyst
Image Analyst 2016๋…„ 3์›” 27์ผ

0 ๊ฐœ ์ถ”์ฒœ

conv() requires the inputs to be single or double, not logical.

์ถ”๊ฐ€ ๋‹ต๋ณ€ (1๊ฐœ)

Vishnu Teja
Vishnu Teja 2020๋…„ 11์›” 17์ผ

0 ๊ฐœ ์ถ”์ฒœ

Can any one solve this question Compute the convolution y[n] = x[n] * h[n] when ๐‘ฅ(๐‘›) = ๐‘Ž๐‘›u(n),0 < a< 1, โ„Ž(๐‘›) = ๐‘๐‘›u(n), 0 < b< 1 Assume that a and b are not equal.

๋Œ“๊ธ€ ์ˆ˜: 1

Image Analyst
Image Analyst 2020๋…„ 11์›” 17์ผ
This is not an answer for Zeeshan. Please start your own question and explain why y=conv(x, h) does not work for you. And explain your definition of u.

๋Œ“๊ธ€์„ ๋‹ฌ๋ ค๋ฉด ๋กœ๊ทธ์ธํ•˜์‹ญ์‹œ์˜ค.

์นดํ…Œ๊ณ ๋ฆฌ

๋„์›€๋ง ์„ผํ„ฐ ๋ฐ File Exchange์—์„œ Correlation and Convolution์— ๋Œ€ํ•ด ์ž์„ธํžˆ ์•Œ์•„๋ณด๊ธฐ

ํƒœ๊ทธ

์งˆ๋ฌธ:

2016๋…„ 3์›” 27์ผ

๋Œ“๊ธ€:

2020๋…„ 11์›” 17์ผ

Community Treasure Hunt

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

Start Hunting!

Translated by