convolution of two vector

22 visualizaciones (últimos 30 días)
Rica
Rica el 15 de Jul. de 2013
Comentada: Walter Roberson el 4 de Oct. de 2020
hi !
i want to convolute a vector a=[a1 a2 a3 .....an] with the vectors in this matrix
b=[B1 B2 B3....Bn]. B are vectors.
is there any smart method to make this without loops?
C=[conv(a,B1) conv(a,B2)....conv(a,Bn)]
thank you

Respuesta aceptada

Image Analyst
Image Analyst el 15 de Jul. de 2013
out = conv2(b, a);

Más respuestas (1)

Rana Mahmoud
Rana Mahmoud el 4 de Oct. de 2020
yes! you can do the following:
y=conv(a, b)
  1 comentario
Walter Roberson
Walter Roberson el 4 de Oct. de 2020
No, this will not work.
Notice in the original question that B is a matrix -- each is a vector and the result is a 2D array.
conv() cannot be used with a matrix, only with vectors.
You need to use conv2() instead, as shown by Image Analyst.

Iniciar sesión para comentar.

Categorías

Más información sobre Shifting and Sorting Matrices en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by