diff --git a/Code/Matlab/splitFile.m b/Code/Matlab/splitFile.m
index 19e2ddfd73223674c93b1d9f864e1784f60135ed..9b792df485096dcdb8608db911cbd0f6aa6ad620 100644
--- a/Code/Matlab/splitFile.m
+++ b/Code/Matlab/splitFile.m
@@ -14,6 +14,8 @@ if nargin < 5 || isempty(show); show = true; end
   if nargin < 3 || isempty(inPath); inPath = 'E:\'; end
   if nargin < 2 || isempty(outPath); outPath = 'D:\Data\AudioRecorder\'; end
   
+  if ~exist(outPath); mkdir(outPath); end
+  
   inFilename = fullfile(inPath,[name '.wav']);
   outFilename = fullfile(outPath,[name '.wav']);
   outData = fullfile(outPath,[name '.bin']);
@@ -31,7 +33,8 @@ if nargin < 5 || isempty(show); show = true; end
   fa = fopen(outFilename, 'w');
   fd = fopen(outData, 'w');
   
-  totalBytes = dir(inFilename).bytes;
+  fileInfo = dir(filename);
+  totalBytes = fileInfo.bytes;
   audioBytes = 0;
   dataBytes = 0;