Commit 99a6889d authored by adjemian's avatar adjemian
Browse files

Declaration of the paths to the mex files (depending on the version of matlab).

git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1496 ac1d8469-bf42-47a9-8791-bf33cf982152
parent 598a6363
......@@ -9,6 +9,18 @@ function dynare(fname, varargin)
% When extension is omitted, a model file with .mod extension
% is processed.
MATLAB = ver('matlab');
VERSION = str2num(MATLAB.Version);
dynareroot = strrep(which('dynare.m'),'dynare.m','');
addpath([dynareroot 'mex/common/']);
if (VERSION <= 7.4)
addpath([dynareroot 'mex/2007a/'])
elseif (VERSION == 7.5)
addpath([dynareroot 'mex/2007b/'])
end
if ~isstr(fname)
error ('The argument in DYNARE must be a text string.') ;
end
......@@ -33,7 +45,7 @@ if length(d) == 0
disp(['DYNARE: can''t open ' fname])
return
end
dynareroot = strrep(which('dynare.m'),'dynare.m','');
command = ['"' dynareroot 'dynare_m" ' fname] ;
for i=2:nargin
command = [command ' ' varargin{i-1}];
......@@ -46,6 +58,4 @@ end
if ~ isempty(find(abs(fname) == 46))
fname = fname(:,1:find(abs(fname) == 46)-1) ;
end
evalin('base',fname) ;
evalin('base',fname) ;
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment