Can anyone explain this output of 1d conv() function?
1 回表示 (過去 30 日間)
古いコメントを表示
>> u = [1 2 3];
>> v = [1 2 3];
>> w = conv(u, v)
w = 1 4 10 12 9
>>
Can anyone explain this output?
Question #1. How come two vectors of 3 elements generate 5 elements' output?
Question #2. How is the output being calculated?
1 件のコメント
回答 (1 件)
Stephan
2018 年 10 月 27 日
編集済み: Stephan
2018 年 10 月 27 日
Hi,
using:
conv([1,2,3],[1,2,3])
is the equivalent to multiply two polynomials:
(1*x^2 + 2*x + 3) * (1*x^2 + 2*x + 3)
If you simplify this (do the multiplication) you get:
1*x^4 + 4*x^3 + 10*x^2 + 12*x + 9
The coefficient matrix of this resulting polynomial is
[1 4 10 12 9]
which is the same as the result of
conv([1,2,3],[1,2,3])
Best regards
Stephan
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!