From c0f12968ee18f746472c38a0f7eefc1675b5e52c Mon Sep 17 00:00:00 2001
From: Johannes Pfeifer <jpfeifer@gmx.de>
Date: Mon, 29 Apr 2013 22:30:52 +0200
Subject: [PATCH] Create graph folder in rplot if it does not exist

---
 matlab/rplot.m | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/matlab/rplot.m b/matlab/rplot.m
index 31cef9155..d8f8c39be 100644
--- a/matlab/rplot.m
+++ b/matlab/rplot.m
@@ -92,6 +92,14 @@ elseif rplottype == 2
         axis tight;
     end
 end
+% create subdirectory <fname>/graphs if it doesn't exist
+if ~exist(M_.fname, 'dir')
+    mkdir('.',M_.fname);
+end
+if ~exist([M_.fname filesep 'graphs'])
+    mkdir(M_.fname,'graphs');
+end
+
 dyn_saveas(hh,[M_.fname, filesep, 'graphs', filesep, 'SimulatedTrajectory_' deblank(s1(1,:))],options_)
 
 
-- 
GitLab