Compression Routines

버전 1.7.0.0 (7.77 KB) 작성자: Jesse Hopkins
Compress Matlab variables in the workspace. (supports cells, structs, matrices, strings, objects)
다운로드 수: 1.8K
업데이트 날짜: 2010/7/26

라이선스 보기

This Matlab class contains only static methods.
These methods will compress matlab variables using java GZIP functions.
Matrices, strings, structures, and cell arrays are supported. Matlab
objects are also supported provided they implement a "toByteArray" method
and a constructor of the form:
obj = constructor(byteArray,'PackedBytes')

Usage:
x = % some matlab variable,
% can be a struct, cell-array,
% matrix, or object (if object conforms to certain standards)

cx = CompressLib.compress(x); % cx is a byte-array which contains
% compressed version of x

x2 = CompressLib.decompress(cx); %x2 is now a copy of x

The methods CompressLib.packBytes and CompressLib.unpackBytes are also
available. These methods may be used to make Matlab classes compliant
for the compression routines. See "packableObject.m" for an example
Matlab class which is compliant with CompressLib.

Use CompressLib.test to run a series of tests for functionality of this
class.

These methods run pretty fast on numeric variables, however slow down more on structures, cell-arrays and objects. The biggest bottleneck is "typecast.m". You can vastly improve the performance by replacing these calls to typecast.m with the mex counterpart typecastc.mexw32, located in "matlabroot\toolbox\matlab\datatypes\private". Since it is in a private directory, you would have to make a copy of it somewhere else on your path in order for it to be visible publicly. (I noticed a ~37% improvement when running the test suite (CompressLib.test) by doing this.)

인용 양식

Jesse Hopkins (2024). Compression Routines (https://www.mathworks.com/matlabcentral/fileexchange/25656-compression-routines), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2008b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Call Java from MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.7.0.0

Uploaded screenshot

1.3.0.0

Last update for a while.. promise. Some general cleanup, improvements based on profiler results.

1.2.0.0

Changed to a class w/ static methods. Biggest functional change is that packBytes now pre-allocates byteArray. Other changes include better handling of class-names,enumerated values, and element sizes. Also added comprehensive test suite.

1.1.0.0

Minor updates to help comments in attached m-files

1.0.0.0