MATLAB: Dot multipy unequal matrix size. Possible arithmetricdot productmatricesmultiply hello, I have 2 matrices X=20 by 10000 Q= 10000 by 10000 Is it possible to make a Q.*X ? Best Answer Basic Maths:Just for matrix multiplication, you can The number of columns in the first matrix must be equal to the number of rows in the second matrix.But for dot multiplication, how can you do that? Suppose m1(1,1)*m2(1,1)..so onNot have sufficient elements to pair each other. For dot operation both must have same sizes.So the answer is No. Related SolutionsMATLAB: Multiplying matrices of different sizes It seems that you are looking for element-wise multiplication, with singleton dimension expansion... which is what bsxfun is for:>> A = rand(10,29,34,28);>> B = (1:10)';>> C = bsxfun(@times,A,B);>> size(C)ans = 10 29 34 28 MATLAB: Multiplication of two matrices of different rank RESHAPE is a cleanest and fastest way to do tensor-extension of mtimes on multi-dimension arrays.szA = size(A);szB = size(B);n = szB(1);if n ~= 1 || szA(end)==1 szA(end) = [];endszB(1) = [];AB = reshape(A,[prod(szA),n])*reshape(B,[n,prod(szB)]);AB = reshape(AB,[szA,szB]); Related QuestionHow to multipy two polynomial expressionHow to create N+1 dimensional array by taking exterior product of 1st dimension of two N dimensional arraysIs this possibleMatching unequal arrays
Best Answer