필터 지우기
필터 지우기

How to perform a matrix multiplication for row vectors and output results as a matrix?

조회 수: 2 (최근 30일)
Below is a problem and its ugly solution. Any thoughts for an elegant solution?
M = [1 2 3; 4 5 6; 7 8 9];
C = [10 11 12; 13 14 15; 16 17 18; 19 20 21; 22 23 24];
K1=(M*C(1,:)')';
K2=(M*C(2,:)')';
K3=(M*C(3,:)')';
K4=(M*C(4,:)')';
K5=(M*C(5,:)')';
B = vertcat(K1,K2,K3,K4,K5)

채택된 답변

Andrei Bobrov
Andrei Bobrov 2013년 7월 5일

추가 답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 7월 5일
편집: Azzi Abdelmalek 2013년 7월 5일

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by