evaluate_static_model: fix crash under Octave with bytecode

Octave does not want to create a function handle to a nonexistent function
(<MODFILE>_static.m) in that case
time-shift
Sébastien Villemot 2011-12-14 10:39:32 +01:00
parent 4e0801a92d
commit 6bfeb91e99
1 changed files with 15 additions and 13 deletions

View File

@ -38,12 +38,13 @@ function [residuals,check1,jacob] = evaluate_static_model(ys,exo_ss,params,M,opt
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
check1 = 0;
fh_static = str2func([M.fname '_static']);
if options.bytecode
[check1, residuals] = bytecode('evaluate','static',ys,...
exo_ss, params, ys, 1);
mexErrCheck('bytecode', check1);
elseif options.block
else
fh_static = str2func([M.fname '_static']);
if options.block
residuals = zeros(M.endo_nbr,1);
mfs = M.blocksMFS;
for b = 1:size(mfs,1)
@ -57,3 +58,4 @@ function [residuals,check1,jacob] = evaluate_static_model(ys,exo_ss,params,M,opt
else
residuals = feval(fh_static,ys,exo_ss,params);
end
end