Quick save functions

sd: Save Data ld: Load Data sf: Save Figure
2 Downloads
Updated 2 Jan 2026

View License

Architecure to preset a separate location to save data.
Usage:
sd (save data): sd('project_folder/mat_file_name', var1, var2, .... varN)
ld (load data): dat =ld('project_folder/mat_file_name')
sf (save figure): sf()
OR
sf('project_folder/figure_name')
Requires setting RootPath & StoragePath variables in startup such that:
Figures will be saved at RootPath\StoragePath\Results\
Data will be save at RootPath\StoragePath\Data\
My choice is typically: RootPath = pwd; StoragePath = '../../Matlab-Storage'
Saving data generates a structure that can be read in with the loading data function.
Load data loads as a structure, so recursive save/load/save calls will produce ugly nested structures (although these can be useful too!). To avoid this there is an option to generate the full data loading call that will not load the data as a structure. This can be copied & pasted into the terminal to load the variables as they were initially.
Work remaining:
  • Add project folder functionality (set project folder as subfolder of Results & Data folders)
  • Improved save data saving (auto save all workspace variables)
  • Improved save data structure loading (optionally return variables to initial states)

Cite As

Natalie Mujica-Schwahn (2026). Quick save functions (https://in.mathworks.com/matlabcentral/fileexchange/182967-quick-save-functions), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2025b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Version Published Release Notes
1.0.0