Multiply each individual cell by a single matrix
Show older comments
I need to multiply each cell of a cell array by a single matrix, and store the result in the same size cell array.
I know how to do this with a for loop, but I was wondering if there was a faster/more efficient way?
For example:
Cell = {[1 2; 3 4; 5 6]; [7 8; 9 10; 11 12]};
matrix = [1 2; 3 4];
Then I would want Cell{1} * matrix stored in result{1}, Cell{2} * matrix stored in result{2}, so on and so forth till I get:
result = {[Cell{1} * matrix]; [Cell{2} * matrix]};
result =
{[7 10; 15 22; 23 34]; [31 46; 39 58; 47 70]}
Is it possible to perform this without a for loop?
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!