diff --git a/matlab/datatomfile.m b/matlab/datatomfile.m
index 4c7abec23507e94c881ae07681d37834ec78228c..4f6a5ff49acd04aabdefa4194da65c2e7e77f9c2 100644
--- a/matlab/datatomfile.m
+++ b/matlab/datatomfile.m
@@ -1,20 +1,23 @@
-function datatomfile (s,var_list, names)
-% function datatomfile (s,var_list)
-% This optional command saves the simulation results in a text file. The name of each
-% variable preceeds the corresponding results. This command must follow SIMUL.
+function datatomfile (s, var_list, names)
+
+% This command saves the simulation results in a text file. The name of each
+% variable preceeds the corresponding results. This command must follow SIMUL
+% or STOCH_SIMUL commands.
 % 
-% INPUTS
-%    s:              data file name
-%    var_list:       vector of selected endogenous variables
-%    names:          vector of strings (alternative names for the endogenous variables in the data file)
+% INPUTS 
+%  - s:              data file name
+%  - var_list:       vector of selected endogenous variables
+%  - names:          vector of strings (alternative names for the endogenous variables in the data file)
 %
-% OUTPUTS
-%    none
+% OUTPUTS 
+% none
 %
-% SPECIAL REQUIREMENTS
-%    none
+% REMARKS 
+% Only the first argument is mandatory. If only one input argument is
+% provided, all the variables as defined in M_.endo_names will be saved in
+% the generated m file.
 
-% Copyright (C) 2001-2016 Dynare Team
+% Copyright (C) 2001-2017 Dynare Team
 %
 % This file is part of Dynare.
 %