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
댓글 수: 0
채택된 답변
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 Center 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!