Multiply a cell array with a matrix in an equation
Mostrar comentarios más antiguos
Hello, I have a cell array like below (let's call it C).
C:

And a 4*4 matrix for example:
A=rand(4,4);
I want to multiply these arguments (multiply the first component of A (A(1,1)) to all the values in the first component of C(C{1})) in an equation such that:
eqn=A*C + (1-A)*C
How can I do this?
I tried for loop but didn't work. I also tried to just use element wise multiplication but didn't work either, I get the error below:
Operator '.*' is not supported for operands of type 'cell'.
2 comentarios
Matt J
el 9 de Jul. de 2021
I tried for loop but didn't work
Since you haven't shown us the code you tried, we cannot tell you why it didn't work.
MarshallSc
el 9 de Jul. de 2021
Editada: MarshallSc
el 9 de Jul. de 2021
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!