MATLAB: Multiply cell doubles with a matrix multiply cell doubles with a matrix I have a cell array A which has 1*5 cell, each cell has 12*1 doubles. How multiply those 12*1 doubles with a MATRIX call B with 12*500 ? Thank you Best Answer out = bsxfun(@times,permute(cell2mat(A),[1,3,2]),B); % out - 3D double arrayorout = cellfun(@(x)bsxfun(@times,x,B),A,'un',0); % here out - cell array (1 x 5) Related SolutionsMATLAB: Transform a 3×1 cell array containing {2×4}cell arrays into 2×1 cell array containing {3×4}cell arrays out = mat2cell(cat(1,C{:}),[3 3],4) MATLAB: Divide a cell arrays with a part of another cell array Try this:C = num2cell(bsxfun(@rdivide,cell2mat(A),cell2mat(B(1,2:end))));Note that B{1,2:end} using the curly braces will be a comma-separated-list of the contents of B, whereas B(1,2:end) using parentheses will simply be another cell array. Related QuestionHow to convert 66 x 2 cell array into matrixConvert cell to arrayHow to multiply each row of a matrix with every row of another matrix elementwiseExtract and realign cells into new cellConverting cell array to matrixSum values in a cell array
Best Answer