diff --git a/matlab/missing/mex/local_state_space_iterations/local_state_space_iteration_2.m b/matlab/missing/mex/local_state_space_iterations/local_state_space_iteration_2.m
index 23e8a9fe999015e755686e61012cc1bd5f3dfa2e..28c30f3f37c8a964745569ff80cde51b41323baf 100644
--- a/matlab/missing/mex/local_state_space_iterations/local_state_space_iteration_2.m
+++ b/matlab/missing/mex/local_state_space_iterations/local_state_space_iteration_2.m
@@ -93,13 +93,13 @@ ghuu = rand(n,q*q);
 ghxu = rand(n,n*q);
 yhat_ = zeros(n,1);
 ss = ones(n,1);
-
+addpath(sprintf('%s/missing/mex/local_state_space_iterations', fileparts(which('dynare'))))
 % Call the tested routine.
 for i=1:10
     y1 = local_state_space_iteration_2(yhat,epsilon,ghx,ghu,constant,ghxx,ghuu,ghxu,1);
     [y2,y2_] = local_state_space_iteration_2(yhat,epsilon,ghx,ghu,constant,ghxx,ghuu,ghxu,yhat_,ss,1);
 end
-
+rmpath(sprintf('%s/missing/mex/local_state_space_iterations', fileparts(which('dynare'))))
 % Check the results.
 t(1) = dassert(y1,ones(n,1));
 t(2) = dassert(y2,ones(n,1));