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 Center および File ExchangeSystem Composer についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by