필터 지우기
필터 지우기

Pleaaaase help me !!!! i didn't got a result with this code.

조회 수: 1 (최근 30일)
yousra yahia
yousra yahia 2018년 5월 2일
댓글: yousra yahia 2018년 5월 2일
Af=diag([-10 -10])
Da=[4.3970 33.4300;
-0.4182 -1.1780]
Ba=[0 0;6.8060 9.2750;
-1.7700 -0.7986;
0 0;0 0;
6.1130 -42.0300;
0 0;
-20.2700 -13.2900]
B=[Ba -Af*Da]
Af =
-10 0
0 -10
Da =
4.3970 33.4300
-0.4182 -1.1780
Ba =
0 0
6.8060 9.2750
-1.7700 -0.7986
0 0
0 0
6.1130 -42.0300
0 0
-20.2700 -13.2900
Error using horzcat
Dimensions of matrices being concatenated are not consistent.

채택된 답변

Walter Roberson
Walter Roberson 2018년 5월 2일
Your Ba is 8 x 2.
Your Af and Da are 2 x 2, and when you matrix-multiply a 2 x 2 with a 2 x 2 you get a 2 x 2, so -Af*Da is 2 x 2.
You are trying to create a matrix in which the first two columns have 8 rows, but the last two columns contain only 2 rows.
What size of output were you expecting?
  댓글 수: 2
yousra yahia
yousra yahia 2018년 5월 2일
Af=diag([-10 -10]) Da=[4.3970 33.4300; -0.4182 -1.1780] Ba=[0 0;6.8060 9.2750; -1.7700 -0.7986; 0 0;0 0; 6.1130 -42.0300; 0 0; -20.2700 -13.2900] B=[Ba ; -Af*Da]
B =
0 0
6.8060 9.2750
-1.7700 -0.7986
0 0
0 0
6.1130 -42.0300
0 0
-20.2700 -13.2900
43.9700 334.3000
-4.1820 -11.7800
yousra yahia
yousra yahia 2018년 5월 2일
Thank you i get the result.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by