Circular convolution with single element array showing error

Hi ,
When I try to do circular convolution of two vectors,it shows error when one of the vectors is single element.
How do I rectify the problem? The error message is shown below:
>> s=[1];
>> q=[1 2];
>> res=cconv(s,q)
Error
Error using .* Matrix dimensions must agree.
Error in cconv (line 46)
c = ifft(fft(datawrap(a,N),N).*fft(datawrap(b,N),N));

4 件のコメント

per isakson
per isakson 2019 年 1 月 22 日
On my R2018b your code outputs
res =
1
2
>>
Deepa Abraham
Deepa Abraham 2019 年 1 月 22 日
I am using version R2015b, I guess that may be the problem.
Thank you for reply
KSSV
KSSV 2019 年 1 月 22 日
Try transposing ...
Deepa Abraham
Deepa Abraham 2019 年 1 月 22 日
Yes,
Thanks, Now no issues

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeData Distribution Plots についてさらに検索

質問済み:

2019 年 1 月 22 日

コメント済み:

2019 年 1 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by