Writing a long equation in MATLAB
Show older comments
Hi,
I need help writing this equation in MATLAB:

where:


My proposed code is:
d = ((1/(gamma*(abar(t-1,1) - a(t-1,1))))*(1+(a(t-1,1)/(gamma*(abar(t-1,1) - a(t-1,1))))));
GAMMA = gamma*(abar(t-1,1) - a(t-1,1);
exp(-rho*t)*gamma*(abar(t-1,1) - a(t-1,1))*((exp(-(rho+d)*t)/c0)-(exp(-rho*t)/(GAMMA*d))))^(-1);
The code doesn't generate the right numbers though. Is it written correctly?
Thanks!
1 Comment
David Hill
on 25 Aug 2022
Show us your code and ask a specific question. You should also describe or attach your variables and constants.
Accepted Answer
More Answers (0)
Categories
Find more on Gamma Functions in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!