diff --git a/matlab/ep/ep_problem_0.m b/matlab/ep/ep_problem_0.m
index 5ec81b475fd6899f67e666b24aefe01a06c37e2b..08f052a75135b414af65f5d3336805e5b2f07c53 100644
--- a/matlab/ep/ep_problem_0.m
+++ b/matlab/ep/ep_problem_0.m
@@ -1,5 +1,21 @@
 function [res, A, info] = ep_problem_0(y, x, pfm)
 
+% Evaluate the residuals and stacked jacobian of a stochastic perfect
+% foresight, considering sequences of future innovations in a perfect n-ary tree.
+%
+% INPUTS:
+% - y      [double]   m×1 vector (endogenous variables in all periods and future worlds).
+% - x      [double]   q×1 vector of exogenous variables.
+% - pfm    [struct]   Definition of the perfect foresight model to be solved.
+%
+% OUTPUTS:
+% - res    [double]   m×1 vector, residuals of the stacked equations.
+% - A      [double]   m×m sparse matrix, jacobian of the stacked equations.
+% - info   [logical]  scalar
+%
+% REMARKS:
+% [1] The structure pfm holds the given initial condition for the states (pfm.y0) and the terminal condition
+
 info = false;
 
 params = pfm.params;
diff --git a/matlab/ep/ep_problem_1.m b/matlab/ep/ep_problem_1.m
index 9579e7dbf1aca75b9f5bd8c4290b386b6a2138cd..4c19baff6cdb54194b700c35a954521ea71114a7 100644
--- a/matlab/ep/ep_problem_1.m
+++ b/matlab/ep/ep_problem_1.m
@@ -1,4 +1,20 @@
-function [res,A,info] = ep_problem_1(y, x, pfm)
+function [res, A, info] = ep_problem_1(y, x, pfm)
+
+% Evaluate the residuals and stacked jacobian of a stochastic perfect
+% foresight, considering sequences of future innovations in a sparse tree.
+%
+% INPUTS:
+% - y      [double]   m×1 vector (endogenous variables in all periods and future worlds).
+% - x      [double]   q×1 vector of exogenous variables.
+% - pfm    [struct]   Definition of the perfect foresight model to be solved.
+%
+% OUTPUTS:
+% - res    [double]   m×1 vector, residuals of the stacked equations.
+% - A      [double]   m×m sparse matrix, jacobian of the stacked equations.
+% - info   [logical]  scalar
+%
+% REMARKS:
+% [1] The structure pfm holds the given initial condition for the states (pfm.y0) and the terminal condition
 
 info = false;
 A = [];