Multiplication between 2 matrix

조회 수: 1 (최근 30일)
Danilo Teran
Danilo Teran 2017년 11월 6일
편집: Danilo Teran 2017년 11월 6일
Hi, I need to multiply one matrix, which only number has A = [1 0; 2 3] with a matrix(array) with variables, which are not define yet, but they are numbers, which are not yet defined B = [a b; c d]
I need to get one general solution in order to change a,b,c,d values
Thanks in advance

채택된 답변

Mischa Kim
Mischa Kim 2017년 11월 6일
편집: Mischa Kim 2017년 11월 6일
Danilo, use the Symbolic Math Toolbox
syms B C a b c d
A = [1 0; 2 3];
B = [a b; c d];
C = A*B
C =
[ a, b]
[ 2*a + 3*c, 2*b + 3*d]
  댓글 수: 1
Danilo Teran
Danilo Teran 2017년 11월 6일
편집: Danilo Teran 2017년 11월 6일
Hi Mischa,
I get it, but as you can see there ist not a mtrix there. In my example I need to do this syms S1 A1 S2 A2 K2 A B C Ss K12 TR AR BR CRT TER1 e BN AII BI CIT A=[-K12/A1 K12/A1 ; K12/A2 -(K12+K2)/A2] B=[S1/A1 0; 0 S2/A2] C=[1 0; 0 K2]
Ss=[B A*B]
STR=[0 1]*inv(Ss)
TR=inv([STR;STR*A])
% TR1=inv([STR;STR*A])
AR=inv(TR)*A*TR
BR=inv(TR)*B
CRT=C*TR
TRE1=[C C*inv(A);STR STR*A]
TE=inv(TRE1)
AE=TRE1*A*TE
BE=TRE1*B
CET=C*TE
zer=tzero(A,B,C,0);
e=C*A*TE
BN=[0 1/CRT(2)]
AII=AE(1,1)
BI=[0 CRT(2)]
CIT=[1 0]
CTN=(1/BN(2))*e
ANN=AE(2,2)
My number values will be S1 S2 A1 A2 K12
But I am getting a problem
Error in Matrixconletras (line 9) STR=[0 1]*inv(Ss)

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

추가 답변 (1개)

Jan
Jan 2017년 11월 6일
Or perhaps:
C = [a, b; ...
2*a + 3*c, 2*b + 3*d];

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by