Code covered by the BSD License  

Highlights from
Save and load data to a MAT-file in temporary directory

Save and load data to a MAT-file in temporary directory

by

 

14 May 2012 (Updated )

Save and load temporary results to a MAT-file inside $TEMP$ directory

erasetmp(fname)
%ERASETMP Erase file in temp directory
%   ERASETMP(FILENAME) erases file FILENAME in temp directory
%
%   See also TEMPDIR, SAVETMP, LOADTMP, DELETE

% Copyright 2011 by Vladimir Filimonov (ETH Zurich).
% $Date: 11-Jul-2011 20:05:49 $ 

function erasetmp(fname)

tmp = tempdir;

if exist([tmp fname '.mat'], 'file')
    delete([tmp fname '.mat'])
    disp([tmp fname '.mat deleted'])
    
elseif exist([tmp fname], 'file')
    delete([tmp fname])
    
else
    warning([tmp fname ' was not found'])
    
end

Contact us