diff --git a/matlab/resol.m b/matlab/resol.m
index cae7a1a49cbdad4ef95548f4f05d301bb94725ac..5e7c024d7b62d777cd629b2cdd0505c9c40c0fb5 100644
--- a/matlab/resol.m
+++ b/matlab/resol.m
@@ -116,7 +116,7 @@ if options.loglinear
         fprintf('You are attempting to simulate/estimate a loglinear approximation of a model, but\n')
         fprintf('the steady state level of the following variables is not strictly positive:\n')
         for var_iter=1:length(idx)
-            fprintf(' - %s (%s)\n',deblank(variables_with_non_positive_steady_state(var_iter,:)), num2str(dr.ys(idx)))
+            fprintf(' - %s (%s)\n',deblank(variables_with_non_positive_steady_state(var_iter,:)), num2str(dr.ys(idx(var_iter))))
         end
         if isestimation()
             fprintf('You should check that the priors and/or bounds over the deep parameters are such')