File: testgz.m

package info (click to toggle)
mwrap 1.2.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 980 kB
  • sloc: cpp: 3,271; ansic: 856; makefile: 252; lex: 233; sh: 2
file content (19 lines) | stat: -rw-r--r-- 425 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
% testgz.m
%   Test/demo a MWrap wrapper to the ZLib compression library.
%
% Copyright (c) 2007  David Bindel
% See the file COPYING for copying permissions

A = eye(100);

fprintf('Writing identity to eye.gz\n');
fp = gzopen('eye.gz', 'w');
gzwrite(fp, A);
gzclose(fp);

fprintf('Reading identity back from eye.gz\n');
fp = gzopen('eye.gz', 'r');
B = gzread(fp);
gzclose(fp);

fprintf('Difference is = %g\n', norm(A-B,1));