MATLAB: Devision of matrix by matrix matrix devision Hi, Please excuse total n00b here. I am after devision of matrix by a second matrix, example; x = [4; 8; 12; 16; 20]; y = [2 4]; I want x/y to give ans = [2 1; 4 2; 6 3; 8 4; 10 5] Thanks Ad Best Answer The bsxfun() command will automatically replicate arrays across the dimensions you need:bsxfun(@rdivide,x,y)I recommend reading "doc bsxfun" to get an understanding of the function. Related SolutionsMATLAB: Changing the Structure of a Matrix. y = reshape(x.',1,[]) MATLAB: Expansion on the Devision of matrix by matrix Q Well, you will have to define the order of the columns you want in the result, butbsxfun(@times, kron(Qa,[1 1]), kron([1 1],y))or (different column order)bsxfun(@times, kron([1 1],Qa), kron(y,[1 1])) Related QuestionWhat is the formula of left devisionReshape 3d to 2d arrayHow to plot a combination of product and devision of some vectorsRearrange matrix to vectorCentered FFT & DFT: cannot devise required phase shift vector(s).
Best Answer