help I need matlab code that multiply each element in each coulmn by a each element in avector with the same length

조회 수: 2 (최근 30일)
help I need matlab code that multiply each element in each coulmn by a each element in avector with the same length

채택된 답변

Star Strider
Star Strider 2015년 1월 13일
편집: Star Strider 2015년 1월 13일
Use bsxfun:
m = rand(10,5);
v = rand(10,1);
vm = bsxfun(@times, v, m);
Here, ‘m’ is the matrix, ‘v’ is the vector, and ‘vm’ is the element-by-element product of the columns of ‘m’ and column vector ‘v’.
  댓글 수: 4

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by