I have a vector A=[2; 3; 5; 6] , I would like to multiply each row with all other rows to get a matrix. In this case, the output should be Output=[ 6 6 10 12; 10 15 15 18; 12 18 30 30]. For example, the first column of the output will be obtained by multiplying the first element of A with all the elements to get the Output(:,1)=[A(1,:)*A(2,:),A(1,:)*A(3,:), A(1,:)*A(4,:)]. Similarly, I would want to do for 2nd 3rd and 4th elemnt of A. But as you notice, my way is manual. Is there a rather quicker, more automated, way to obtain the Output as I showed above. Thanks in advance
MATLAB: How to multiply each row with all rows within a column vector
multiplication within vector elements
Related Question
- Convert matrix in single column/row vector
- Sorting rows
- Matrix manipulation: split matrix in vectors
- Subtract row from previous row
- When given a matrix with x columns, how do you multiply the first column by 1, the second column by 2, etc
- Averaging rows with rows previous
- Reshape a matrix into vector using rows
- Rows contained in other rows
Best Answer