필터 지우기
필터 지우기

Matrix Multiplication Help

조회 수: 1 (최근 30일)
Euan
Euan 2011년 11월 12일
I have 2 matrix. A=[1 2 3], B=[3 4 5 6 7 8]
What id like to do is for every value in A, multiply it by B. So end up with
C = 3 6 9
4 8 12
5 10 15
6 12 18
7 14 21
8 16 24
Any help would be much appreciated. Thanks

채택된 답변

bym
bym 2011년 11월 12일
  댓글 수: 2
Fangjun Jiang
Fangjun Jiang 2011년 11월 12일
Yup! I was stuck with bsxfun() too! +1
David Young
David Young 2011년 11월 12일
+1, yes, but for generality better to use .' in case b is complex.

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

추가 답변 (1개)

David Young
David Young 2011년 11월 12일
bsxfun(@times, A, B.')

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by