Problem with solve matrix

조회 수: 12 (최근 30일)
Nguyen Tien Dung
Nguyen Tien Dung 2020년 7월 5일
댓글: jose antonio valles 2021년 11월 26일
Hi everyone,Can you help me solve this problem
clc
clear all
disp('An economic system composed of 3 sectors has the input-output matrix');
D=[0.5,0.1,0.1;0.2,0.5,0.3;0.1,0.3,0.4]
disp('The output vector X when the external demands are E');
E=[7900;3950;1975]
disp(['To meet the outside demand,the vector X must satisfy the Leontief equation:' ...
'X=DX+E =>(I-D)X=E=>X=((I-D)^(-1))E']);
I=[1,0,0;0,1,0;0,0,1]
X = [(I-D)^(-1)]*E
and X=(inv(I-D))*E
but all answer error and don't give right answer X=[27500;33750;24750]
  댓글 수: 2
jose antonio valles
jose antonio valles 2021년 11월 26일
and, this is you error
jose antonio valles
jose antonio valles 2021년 11월 26일
and the last row is repeated "and X=(inv(I-D))*E"

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

채택된 답변

Stephan
Stephan 2020년 7월 5일
For me your code works:
disp('An economic system composed of 3 sectors has the input-output matrix');
D=[0.5,0.1,0.1;0.2,0.5,0.3;0.1,0.3,0.4]
disp('The output vector X when the external demands are E');
E=[7900;3950;1975]
disp(['To meet the outside demand,the vector X must satisfy the Leontief equation:' ...
'X=DX+E =>(I-D)X=E=>X=((I-D)^(-1))E'])
I=[1,0,0;0,1,0;0,0,1]
X = ((I-D)^(-1))*E
X=(inv(I-D))*E
results in:
An economic system composed of 3 sectors has the input-output matrix
D =
0.5000 0.1000 0.1000
0.2000 0.5000 0.3000
0.1000 0.3000 0.4000
The output vector X when the external demands are E
E =
7900
3950
1975
To meet the outside demand,the vector X must satisfy the Leontief equation:X=DX+E =>(I-D)X=E=>X=((I-D)^(-1))E
I =
1 0 0
0 1 0
0 0 1
X =
1.0e+04 *
2.7500
3.3750
2.4750
X =
1.0e+04 *
2.7500
3.3750
2.4750

추가 답변 (0개)

카테고리

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

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by