% Copyright (C) 2001 Michel Juillard
%
function dynare(fname)
%	DYNARE ( 'Filename' )
%	This command runs the .MOD file (or .DYN) specified in Filename.
%	Filename could be enter with or without the .MOD extension.

if ~ isstr(fname)
	error ('The argument in DYNARE must be a text string.') ;
end

%cfb command = ['c:\dynare\matlab\dynare_m ' fname] ;

command = ['/Applications/MATLAB6p5/dynare/matlab/dynare_m ' fname] ;
dos (command) ;
'Press enter to continue'
pause;

if ~ isempty(find(abs(fname) == 46))
	fname = fname(:,1:find(abs(fname) == 46)-1) ;
end

evalin('base',fname) ;


% MJ 2/9/99: replace clear function by clear ff_
% MJ 4/7/00: change the path of dynare_m
% MJ 02/26/01: replaced local variable x by fname
% MJ 09/19/01: evaluates mod script in 'base' workspace