Dynare path malfunction

Good evening. I am currently trying to build an RBC model with traditional and shadow banks and introducing a Taylor rule. After trying to run a code, MATLAB suddenly could not find the path to Dynare, when it was previously working. The error is:

%-----------------------------------------------------------------------------------------------------------------------------

Error using verLessThan (line 41)
Toolbox ‘matlab’ not found.
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 Mainshadow (line 53)
dynare Shadowdyn.mod noclearall
^^^^^^
Warning: Class ‘datetime’ is defined in a class folder and takes precedence over a function with the same name
that is earlier on the MATLAB path. In a future release, class ‘datetime’ will no longer be given precedence.

Click here for the locations of the conflicting items.
Click here for guidelines to avoid this warning.

%-----------------------------------------------------------------------------------------------------------------------------

Mainshadow.m (1.7 KB)
Shadowdyn.mod (6.0 KB)

This seems like a weird Matlab problem that we were unable to resolve in the past: Error using verLessThan (line 41) Toolbox 'matlab' not found

Hello. Thanks for the swift reply! I was able to fix it by adding these lines:

%--------------------------------------------------------------------------

% 4. Call Dynare

%--------------------------------------------------------------------------

restoredefaultpath;

rehash toolboxcache;

savepath;

addpath(‘C:\dynare-6.2\matlab’);

dynare Shadowdyn.mod noclearall

rmpath(‘C:\dynare-6.2\matlab’);