Dynare (line 281) evalin('base',[fname '.driver']

I’m using Matlab 2022b and the dynare5.2. When I execute the example1.mod file, it’s not working. And it showed me that "dynare (line 281) evalin (‘base’, [fname ‘.driver’]. I have find many ways but it still can’t be solved. I really need some help to solve it.

What is the full error message?

Starting Dynare (version 5.0).
Calling Dynare with arguments: none
Starting preprocessing of the model file …
Found 6 equation(s).
Evaluating expressions…done
Computing static model derivatives (order 1).
Computing dynamic model derivatives (order 2).
Processing outputs …
Preprocessing completed.

无法解析名称(The name could not be resolved) ‘example1.driver’。

error dynare (line 281)
evalin(‘base’,[fname ‘.driver’]);

That’s the all error.

That is strange. Does you full file path include any non-standard characters that may throw off Matlab?

Sorry, I don’t quite understand what you mean. I add the Matlab file of Dynare to Matlab. The file path was copied. So I think it’s correct.

I meant the full path. In my case it would be


I just ran example1.mod on my system without any problem. I am using MATLAB 2022a with Dynare 5.2. My path is


This is my window. I put Dynare file in the Matlab file. Is this what caused this error?

Can you go to the Dynare folder on C drive where you installed it and find the examples folder? Inside you will have example1.mod. Can you navigate to that folder from your MATLAB (set that as your current MATLAB folder) and then try running the file?

In the +example1-subfolder, is there a file called driver?

yeah,there is a file calle

d driver.

I just run the example1.mod, but it still doesn’t work.
The error is “The use of operators is invalid.”

How did you try to run it? It seems you tried to execute it as Matlab code.

I try to run it by using “dynare example1.mod”, but get the error
"(The name could not be resolved) ‘example1.driver’。

error dynare (line 281)
evalin(‘base’,[fname ‘.driver’]);"

Did you try running the file by typing in MATLAB Command Window the following statement?

dynare example1

If this doesn’t work, maybe deleting the example1.driver file and then trying to run example1.mod might help.

I have worked out this problem! I share my resolution:
I created a working folder, works, outside of the matlab directory to place the mod files. Then in matlab

cd:\soft\ works
dynare bkk