0

I have a matrix A of size r x c, c is constant but r can vary. I have a row vector of length c.

I need to produce a matrix which is product of multiply each row in A by the row vector.

I have tried

new_matrix = A * row_vector 

but it returns an error because they aren't the same shape.

0

1 Answer 1

3

use bsxfun:

bsxfun(@times,A,row_vector) 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.