MATLAB: Multiply col vector with matrix MATLAB I have matrix and one column vector. I want to multiply column vector with each of column in matrix. Let say matrix is M and column is N, I want to multiply N with each column of M. Best Answer You can do it like this.bsxfun(@times,M,N)If N is column vector then each colmn in M is multiplied by N, else if N is row vector then each row in M is multiplied by N. Related SolutionsMATLAB: How to reshape each column of a matrix reshape(A,512,[],243) MATLAB: Can I get a lower triangle matrix by multiplying a col vector and a row vector PS. is there any other way to accomplish this summing task fast without this lower triangle matrix? Please tell me.Just use CUMSUM, >> cumsum([1,1,0,0,0,1,0])ans = 1 2 2 2 2 3 3 Related QuestionCreating a matrix by expanding a rowMultiply image with vectorMultiply alongHow to create a matrix of N columns formed by just one vectorVector multiplied a matrix
Best Answer