Problem with solve matrix

12 visualizaciones (últimos 30 días)
Nguyen Tien Dung
Nguyen Tien Dung el 5 de Jul. de 2020
Comentada: jose antonio valles el 26 de Nov. de 2021
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 comentarios
jose antonio valles
jose antonio valles el 26 de Nov. de 2021
and, this is you error
jose antonio valles
jose antonio valles el 26 de Nov. de 2021
and the last row is repeated "and X=(inv(I-D))*E"

Iniciar sesión para comentar.

Respuesta aceptada

Stephan
Stephan el 5 de Jul. de 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

Más respuestas (0)

Categorías

Más información sobre System Composer en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by