The Value assigned to variable 'C' might be unused??
Afficher commentaires plus anciens
Hi, I am struggling with a piece of code listed below: I am getting the error 'The Value assigned to variable 'C' might be unused' next to the first 'C' equation below Is there any solution. Thank you.
A= [0; 0; 10];
B= [5 -2 0; -3 2 -1; 0 0 1];
C= [I3; I2; I1];
C= linsolve(B,A)
Réponse acceptée
Plus de réponses (1)
Shu-Han
le 31 Oct 2023
I keep getting this error message that I don't know how to create the data.
Incorrect use of '=' operator. Assign a value to a variable using '=' and compare values
for equality using '=='.
var C K L w r A;
varexo e;
parameters rho delta gamma alpha lambda g;
alpha = 0.33;
delta = 0.1;
rho = 0.03;
lambda = 0.97;
gamma = 0;
g = 0.015;
model;
1/C= 1/(1+rho)*(1/(C(+1)*(1+g)))*(r(+1)+1-delta);
L^gamma = w/C;
r = alpha*A*(K(-1)/(1+g))^(alpha-1)*L^(1-alpha);
w = (1-alpha)*A*(K(-1)/(1+g))^alpha*L^(-alpha);
K+C = (K(-1)/(1+g))*(1-delta)
+A*(K(-1)/(1+g))^alpha*L^(1-alpha);
log(A) = lambda*log(A(-1))-e;
End;
2 commentaires
Walter Roberson
le 31 Oct 2023
To use Dynare you should put the code into a .mod file. To run the code you would go to the command line and
dynare FILENAMEGOESHERE.mod
That will cause the .mod file to be pre-processed into MATLAB and the MATLAB would then be executed
Walter Roberson
le 31 Oct 2023
Should the
+A*(K(-1)/(1+g))^alpha*L^(1-alpha);
line perhaps be on the end of the previous line?
I do not know anything about line continuation in that language.
Catégories
En savoir plus sur Entering Commands dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!