diff --git a/matlab/perfect-foresight-models/sim1_linear.m b/matlab/perfect-foresight-models/sim1_linear.m
index 72a44ff9dd0b498aafa47a51bceceb12f4d7cc31..af75a61b788eff6431fc276b2eff83a68533dc6b 100644
--- a/matlab/perfect-foresight-models/sim1_linear.m
+++ b/matlab/perfect-foresight-models/sim1_linear.m
@@ -113,7 +113,7 @@ z = steadystate_y([ip; ic; in]);
 x = repmat(transpose(steadystate_x), 1+M.maximum_exo_lag+M.maximum_exo_lead, 1);
 
 % Evaluate the Jacobian of the dynamic model at the deterministic steady state.
-[d1, jacobian] = dynamicmodel(z, x, params, steadystate_y, M.maximum_lag+1);
+[d1, jacobian] = dynamicmodel(z, x, params, steadystate_y, M.maximum_exo_lag+1);
 
 % Check that the dynamic model was evaluated at the steady state.
 if max(abs(d1))>1e-12