I have 3*3*20 matrix and 1*1*20 matrix. how to multiply. I have multiply q and za
조회 수: 1 (최근 30일)
이전 댓글 표시
q(:,:,1:20); %3*3 Matrix
za(1:20); % 1*1 Matrix
How to multiply q and za. Error using q*za or q.*za
댓글 수: 0
채택된 답변
Titus Edelhofer
2015년 7월 21일
Hi Ranjan,
if you want to multiply each 3x3 Matrix q(:,:,idx) with the corresponding za(1,1,idx), then this should work:
q = rand(3,3,20);
za = rand(1,1,20);
result = bsxfun(@times, q, za);
Titus
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!