The Value assigned to variable 'C' might be unused??
Show older comments
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)
Accepted Answer
More Answers (1)
Shu-Han
on 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 Comments
Walter Roberson
on 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
on 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.
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!