diff --git a/matlab/dmmgraphs.m b/matlab/dmmgraphs.m
index a0e69d7a4a89836b8f8b0f9be8acc13325493a79..f208a9495ef1e183ada86c5ca099514dab8180a3 100644
--- a/matlab/dmmgraphs.m
+++ b/matlab/dmmgraphs.m
@@ -1,3 +1,4 @@
+function dmmgraphs(path, file, dataset)
 % ------------------------------------------------------------------------
 % DMMgraphs read DMM output and makes graphs of model parameters and unobsevables
 %
@@ -20,15 +21,9 @@
 % along with DMM.  If not, see <http://www.gnu.org/licenses/>.
 % --------------------------------------------------------------------------
 
-
-
-% ---------- to be set by the user  ---------------------------------------
-path = 'h:\arossi\dmm\nile\';   % location of the .nml file e.g. nile.nml
-file = 'nile';                  % name of the nml file
-
-freq      = 1;                  % 1 annual, 4 quarterly, 12 monthly
-startyear = 1985;
-startper  = 1;
+freq      = dataset.freq;
+startyear = dataset.dates(1).time(1);
+startper  = dataset.dates(1).time(2);
 space     = 8;                  % spacing for the tme labels
 NHIST     = 200;                % to compute percentiles
 % -------------------------------------------------------------------------