Preprocessing failed error message

Hello all,

A newbie to both MATLAB and Dynare here!

I’m having trouble running my .m file for a simple RBC model. The model and file was written by my professor as I am an undergraduate student. I have been tasked with getting to grips with the software over the summer with the hope of simulating my own model. Every time I try to run the file, I get the following error message:

terminate called after throwing an instance of ‘std::filesystem::__cxx11::filesystem_error’
what(): filesystem error: cannot remove all: Access is denied [rbcmodel/model/bytecode] [rbcmodel/model/bytecode\block]
Preprocessing time: 0h00m02s.
Error using dynare (line 297)
Dynare: preprocessing failed
Error in rbcsimul (line 14)
dynare rbcmodel.mod;
^^^^^^

I’ve seen that other queries have attached their .mod and .m files so please find mine attached. My MATLAB version is R2024b and my Dynare version is 6.2.
rbcmodel.mod (2.1 KB)
rbcsimul.m (1.6 KB)

I can’t make any progress until this issue is resolved and my professor is away for the summer so any helpful would be greatly appreciated!

Kind Regards,
Henry

See for example

Thank you for the help. I’ve now got another error message:

Unrecognized function or variable ‘c’.
Error in rbcsimul (line 30)
data = [c h K i y A util];

Could you help me understand what is going wrong with my code?

Kind Regards,

Henry

Try this version that is compatible with Dynare 6:
rbcsimul.m (1.6 KB)
rbcmodel.mod (2.1 KB)

Thank so much! That worked. Could you briefly explain what the changes you made were?

Kind Regards,
Henry

Various compatibility fixes, e.g. adjusting from the old char to the new cell arrays, adding the send_endogenous_variables_to_workspace command because Dynare does not duplicate oo_.endo_simul anymore in the workspace, and using Dynare’s HP-filter routine.