Problem with solve matrix

12 views (last 30 days)
Nguyen Tien Dung
Nguyen Tien Dung on 5 Jul 2020
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 Comments
jose antonio valles
jose antonio valles on 26 Nov 2021
and, this is you error
jose antonio valles
jose antonio valles on 26 Nov 2021
and the last row is repeated "and X=(inv(I-D))*E"

Sign in to comment.

Accepted Answer

Stephan
Stephan on 5 Jul 2020
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

More Answers (0)

Categories

Find more on System Composer in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

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

Start Hunting!