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

Version 1.1.0.0 (3.48 KB) by Vladimir
Save and load temporary results to a MAT-file inside $TEMP$ directory
307 Downloads
Updated 15 May 2012

View License

These save / load data to a MAT-file inside temporary directory. At most platforms temp directories are cleaned automatically at every boot, so these scripts are perfect for managing temporary results while keeping working directory clean (e.g. you don't need to care about erasing these *.mat files).

SAVETMP and LOADTMP are simply workaround of standard SAVE and LOAD functions and build in function TEMPDIR. E.g.
savetmp file var1 var2
is identical to
save(fullfile(tempdir,'file.mat'),'var1','var2')

Cite As

Vladimir (2024). Save and load data to a MAT-file in temporary directory (https://www.mathworks.com/matlabcentral/fileexchange/36671-save-and-load-data-to-a-mat-file-in-temporary-directory), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2011a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Workspace Variables and MAT-Files in Help Center and MATLAB Answers
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.1.0.0

"gettmpdir" was replaced by build in function "tempdir"

1.0.0.0