savezip

save/load data in a compressed zip file
750 Downloads
Aktualisiert 29. Aug 2014

Lizenz anzeigen

savezip accepts a file name/path and variable data or name, and stores the data in compressed zip or gzip format in the specified file. If the specified filepath does not include an extension, then '.zip' will be used. The data can be in any Matlab data format.

The data can later be loaded back into Matlab using the corresponding loadzip function, which is included in this submission.

The main benefit: saving and loading data can be faster than Matlab's builtin save and load functions in some cases.

Syntax:
savezip(filepath, data)
savezip(filepath, 'variableName')
data = loadzip(filepath)

Examples:
savezip('myData', magic(4)) %save data to myData.zip in current folder
savezip('myData', 'myVar') %save myVar to myData.zip in current folder
savezip('myData.gz', 'myVar') %save data to myData.gz in current folder
savezip('data\myData', magic(4)) %save data to .\data\myData.zip
savezip('data\myData.gz', magic(4)) %save data to .\data\myData.gz

myData = loadzip('myData');
myData = loadzip('myData.zip');
myData = loadzip('data\myData');
myData = loadzip('data\myData.gz');

Technical description:
http://UndocumentedMatlab.com/blog/savezip-utility

Note:
This utility relies on the undocumented and unsupported serialization functionality, as described in http://undocumentedmatlab.com/blog/serializing-deserializing-matlab-data . It works on all the recent Matlab releases, but might stop working in any future Matlab release without prior notice. Use at your own risk!

Bugs and suggestions:
Please send to Yair Altman (altmany at gmail dot com)

Zitieren als

Yair Altman (2025). savezip (https://de.mathworks.com/matlabcentral/fileexchange/47698-savezip), MATLAB Central File Exchange. Abgerufen.

Kompatibilität der MATLAB-Version
Erstellt mit R2014a
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Kategorien
Mehr zu Low-Level File I/O finden Sie in Help Center und MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Veröffentlicht Versionshinweise
1.0.0.0