Borrar filtros
Borrar filtros

multiplying cell array with a matrix

8 visualizaciones (últimos 30 días)
Leela Sai Krishna
Leela Sai Krishna el 18 de Mayo de 2019
Respondida: Star Strider el 18 de Mayo de 2019
i have 2*1 cell array with size 242*234
and matrix of size 242*234
how to apply above code for it.
i am trying with this
Result=cellfun(@(x)x*matrix,Cell,'un',0)
then i get following error
Error in @(x)x*matrix
or if i try with
matrix=matrix.'
then it gives the out put of 242*242.
In my case i need 242*234 matrix.
please help me to solve this.
thanks in advance.

Respuestas (1)

Star Strider
Star Strider el 18 de Mayo de 2019
You may want to do element-wise (array) multiplication rather than matrix multiplication.
Try this:
@(x)x.*matrix
Note the (.*) element-wise multiplication operator.
See the documentation section on Array vs. Matrix Operations (link) for details.

Categorías

Más información sobre Data Types 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