Rapid lossless data compression of numerical or string variables
by Michael Kleder
01 Nov 2005
(Updated 14 Nov 2005)
No BSD License
Rapidly compresses (or decompresses) Matlab variables in memory
Download Now
|
Watch this File
|
| File Information |
| Description |
Using the public domain ZLIB Deflator algorithm, these two functions (DZIP and DUNZIP) losslessly compress or decompress MATLAB variables of most data types so that they occupy less space. Class type and variable size and shape are stored within the compressed data.
NOTES:
(1) The input variable can be a scalar, vector, matrix, or n-dimensional matrix
(2) The input variable must be a non-complex and full (meaning matrices declared as type "sparse" are not allowed)
(4) In testing, DZIP compresses several megabytes of data per second.
(5) In testing, sparsely populated matrices or matrices with regular structure can compress to less than 10% of their original size. The realized compression ratio is heavily dependent on the data. (For example, a large stream of truly random data is theoretically impossible to compress.)
(6) Variables originally occupying very little memory (less than about half of one kilobyte) are handled correctly, but the compression requires some overhead and may actually increase the storage size of such small data sets. One exception to this rule is noted next.
(7) LOGICAL variables are compressed to a small fraction of their original sizes.
(8) The DUNZIP function decompresses the output of this function and restores the original data, including size and class type.
(9) This function uses the public domain ZLIB Deflater algorithm.
(10) Carefully tested, but no warranty; use at your own risk.
(11) Michael Kleder, Nov 2005 |
| Acknowledgements |
This submission has inspired the following:
Compression Routines
|
| MATLAB release |
MATLAB 7.0.4 (R14SP2)
|
| Other requirements |
Java is called by these functions. |
| Zip File Content |
|
| Other Files |
dunzip.m, dzip.m
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (7) |
| 18 Nov 2005 |
Matlab User
|
|
|
| 18 Mar 2007 |
Pranas Baliuka
|
|
|
| 26 Jul 2007 |
Matlab User
|
|
|
| 31 Oct 2007 |
Zack Voulgaris
|
|
|
| 23 Dec 2008 |
rajchandar k
|
|
|
| 21 Oct 2009 |
Jesse Hopkins
|
|
|
| 26 Oct 2009 |
Jesse Hopkins
|
|
|
| Updates |
| 03 Nov 2005 |
comment clarifications |
| 14 Nov 2005 |
better handling of scalar inputs |
|
MATLAB Central Terms of Use
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Terms prior to use.
Contact us at files@mathworks.com