Multiply each individual cell by a single matrix
이전 댓글 표시
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?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Operators and Elementary Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!