Issues in Matrix multiplication

조회 수: 3 (최근 30일)
Nikolaos Zafirakis
Nikolaos Zafirakis 2019년 4월 16일
편집: Matt J 2019년 4월 16일
I have 100 6 by 6 matrices and 100 6 by 1 matrices and I want to multiply them. If I do X=A.*B it does not give me the correct solution. Does anyone know a way around this?

답변 (2개)

Matt J
Matt J 2019년 4월 16일
편집: Matt J 2019년 4월 16일
A somewhat less efficient solution (but which uses no 3rd party files) is,
A=rand(6,6,100);
B=rand(6,1,100);
C=sum( A.*reshape(B,1,6,[]) ,2);

Matt J
Matt J 2019년 4월 16일
편집: Matt J 2019년 4월 16일

카테고리

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