MATLAB: How to divide a matrix by certain numbers dividedividingmatrixvector I want to divide a matrix by a column vector in this way: (4 2 3 8;7 9 1 5;6 4 8 3) / (4;8;2) and then the result i want to get is: (4/4 2/4 3/4 8/4;7/8 9/8 1/8 5/8;6/2 4/2 8/2 3/2) Best Answer Try this:A = [4 2 3 8;7 9 1 5;6 4 8 3];B = [4;8;2];format ratQ = bsxfun(@rdivide, A, B)Q = 1 1/2 3/4 2 7/8 9/8 1/8 5/8 3 2 4 3/2 Related SolutionsMATLAB: Find the pair of the matrix Maybe you ask for this: D = reshape([a.' circshift(a.',-1)], [], 2); D(size(a,2):size(a,2):end,:)=[]; out =[D fliplr(D)] MATLAB: How to multiply a matrix by certain numbers A = [4 2 3 8;7 9 1 5;6 4 8 3];B = [4;8;2]for i = 1:length(B)C(i,:) = A(i,:)*B(i)end Related QuestionHelp running Matlab scriptQUESTION ON MATRIX RESHAPINGI got the error.”Subscript indices must either be real positive integers or logicals.” do you know whyCall all element inside cell (this cell contain another set of cells)Divide an array in n different arraysFind element in array
Best Answer