Problem with solve matrix

10 次查看(过去 30 天)
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 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