Multiple Convolutions and Indexing using Vectorization

Hi everyone,
I was wondering how to do multiple convolutions and indexing using vectorization in MATLAB. For example, suppose I have a vector A. Then I have many other vectors, x1, x2, ..., xN.
I want to create a vector C such that:
temp = cconv(A, x1);
C(1) = temp(index + 1);
temp = cconv(A, x2);
C(2) = temp(index + 2);
...
temp = cconv(A, xN);
C(N) = temp(index + N);
Note that the variable 'index' remains constant. However, the index of the output of cconv() is not constant.
The number of 'x' vectors could be very large, hence, there could be a large number of cconv()'s. I am already aware of solving this using a for loop, but I am curious how to do this faster.
Thank you for very much for your help in advance.

回答 (1 件)

bym
bym 2011 年 9 月 8 日

0 投票

I don't see how you'd get around using a loop.
That said, are you pre-allocating C?

1 件のコメント

Jrand
Jrand 2011 年 9 月 8 日
Yes, the number of elements in C is known beforehand.

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

カテゴリ

ヘルプ センター および File ExchangeLoops and Conditional Statements についてさらに検索

製品

質問済み:

2011 年 9 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by