Problem with running Dynare

Hello to all,

Please help me. When I try to run a mod file by typing ‘dynare baseline241’ in Matlab, an error message appears saying

‘user_has_matlab_license’ is not a defined function

dynare_config
if ~user_has_matlab_license(‘statistics_toolbox’)

I am using Matlab R2016a with an academic use. Does anyone know what’s the problem?

That is strange. In Dynare’s matlab subfolder, there should be a file

Is is there?

Yes, there is ‘user_has_matlab_license.m’ file in dynare\4.4.3\matlab

What does Matlab return when you type:

What is the reply to

The Matlab returns as follows:

which user_has_matlab_license
C:\dynare\4.4.3\matlab\user_has_matlab_license.m

which dynare
C:\dynare\4.4.3\matlab\dynare.m

That is strange. So Matlab finds the correct Dynare installation and the function it claims it is missing. Have you tried reinstalling Dynare 4.4.3?

Yes, I also tried reinstalling Dynare.

The whole error message is as follows(My language is Korean):

'user_has_matlab_license’은(는) 정의되지 않은 함수 또는 변수입니다.

오류 발생: dynare_config (line 77)
if ~user_has_matlab_license(‘statistics_toolbox’)

오류 발생: dynare (line 48)
dynareroot = dynare_config;

It says that ‘user_has_matlab_license’ is not defined and there is error in dynare_config

Can you please try to just execute in Matlab

user_has_matlab_license(‘statistics_toolbox’)

ans =

 1

This is strange…

Are you always executing all commands in the same folder where the mod-file is located?

Yes all files are located in C:\dynare\4.4.3\matlab

You are not supposed to put your mod-file in the Dynare matlab-folder. Have you tried what happens when you put it somewhere else?

I have newly downloaded example1.mod file from the tutorial section of www.dynare.org and placed it in C:.

There’s still the same error message

dynare example1
’user_has_matlab_license’은(는) 정의되지 않은 함수 또는 변수입니다.

오류 발생: dynare_config (line 77)
if ~user_has_matlab_license(‘statistics_toolbox’)

오류 발생: dynare (line 48)
dynareroot = dynare_config;

I have never encountered something like this before. Could you also put the user_has_matlab_license.m in the folder where the mod-file is located. And please reinstall Dynare after uninstalling and deleting the old Dynare folder. After executing mod-files within the Dynare installation folder there may be files created by the user left that are never deleted otherwise.

I’ve done what you said, but the same error still occurs.
I’ve tried commenting out all the lines that includes ‘user_has_matlab_license’, but now the same error occurs for ‘matlab_ver_less_than’.
Then I’ve commented out all the lines that includes ‘matlab_ver_less_than’, but now the same error occurs for ‘skipline’…

There is something very strange going on. Do other Matlab programs not related to Dynare work as expected?

Other things are working as usual.

Just in case, I’m installing an older version of Matlab 2014b. I’ll let you know if this works.

It doesn’t work in Matlab 2014 either.
But this time, there’s a new error message saying that ‘user_has_matlab_license’ is not defined for ‘char’ type inputs.

This sounds like a Matlab issue for which we cannot really provide support. You might want to look into e.g. de.mathworks.com/matlabcentral/newsreader/view_thread/284393

Thank you for your kind help. I’ll read through the linked page and find out how to fix the problem.