Error using verLessThan (line 41) Toolbox 'matlab' not found

I have Matlab R2024b. I tried to run dynare as follows:

clear
clc
close all
addpath(genpath('C:\dynare'))
dynare RBC_baseline.mod

but I got this error message:

Error in matlab_ver_less_than (line 35)
r = verLessThan('matlab', verstr);
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in dynare (line 90)
    if matlab_ver_less_than('9.5') % Should match the test in meson.build
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in run_dynare (line 6)
dynare RBC_baseline.mod
^^^^^^

I was able to run it successfully on R2023b

Strange. Can you provide the full error message?

1 Like

That is the full error message. I copied and pasted from the Matlab command window.
I have both R2023b and R2024b installed on my computer. Could it be that this creates some kind of conflict?
Strangely, on R2023b Dynare runs fine

But it looks like there must have been one more line at the top of the error message.

1 Like

I show here the error. This is everything I’ve got

So fare I have tested Dynare with Matlab R2023b and R2024a and it works fine. The error is only in R2024b

When you type ver in the command window, does it show something like:

----------------------------------------------------------------------------------------------------
MATLAB Version: 24.2.0.2712019 (R2024b)
MATLAB License Number: -
Operating System: Microsoft Windows 11 
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
MATLAB                                                Version 24.2        (R2024b)
1 Like

Not exactly

>> ver
-----------------------------------------------------------------------------------------------------
MATLAB Version: 24.2.0.2712019 (R2024b)
MATLAB License Number: -
Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 19045)
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
MATLAB                                                Version 24.2        (R2024b)
Curve Fitting Toolbox                                 Version 24.2        (R2024b)
Optimization Toolbox                                  Version 24.2        (R2024b)
Parallel Computing Toolbox                            Version 24.2        (R2024b)
Statistics and Machine Learning Toolbox               Version 24.2        (R2024b)

The difference might be the operating system?

What is your output of

dir([matlabroot '/toolbox'])
1 Like

I get


.             curvefit      eml           livecode      parallel      simulink      
..            dam           experiments   local         physmod       sl3d          
classdiagram  deployment    fixedpoint    matlab        qualkits      stateflow     
coder         diagram       grader        mdom          rptgen        stats         
comparisons   dmr           hdlcoder      optim         shared        target

That is indeed strange and sounds like a weird Matlab bug.

1 Like

Thanks anyways. I can use R2024a instead of R2024b with Dynare, so it’s not a big problem for me