Quick save functions
Version 1.0.0 (2,06 KB) von
Natalie Mujica-Schwahn
sd: Save Data ld: Load Data sf: Save Figure
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)
Zitieren als
Natalie Mujica-Schwahn (2026). Quick save functions (https://de.mathworks.com/matlabcentral/fileexchange/182967-quick-save-functions), MATLAB Central File Exchange. Abgerufen.
Kompatibilität der MATLAB-Version
Erstellt mit
R2025b
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS LinuxTags
Live Editor erkunden
Erstellen Sie Skripte mit Code, Ausgabe und formatiertem Text in einem einzigen ausführbaren Dokument.
| Version | Veröffentlicht | Versionshinweise | |
|---|---|---|---|
| 1.0.0 |
