Skip to content

Commit

Permalink
revert demo script to print outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Aug 18, 2022
1 parent 675c922 commit 2cdc1b4
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions example/demo_zmat_basic.m
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
% addpath('../')

% compression
[dzip, info] = zmat(uint8(eye(5, 5)));
[dzip,info]=zmat(uint8(eye(5,5)))

% decompression
orig = reshape(zmat(dzip, 0), info.size);
orig=reshape(zmat(dzip,0),info.size)

% base64 encoding and decoding
base64 = zmat('zmat toolbox', 1, 'base64');
char(base64);
base64=zmat('zmat toolbox',1,'base64');
char(base64)

orig = zmat(base64, 0, 'base64');
char(orig);
orig=zmat(base64,0,'base64');
char(orig)

% encode ND numeric array
orig = single(rand(5));
[Aencoded, info] = zmat(orig, 1, 'lzma');
orig=single(rand(5));
[Aencoded,info]=zmat(orig,1,'lzma')

% decode compressed ND array and restore size/type
Adecoded = zmat(Aencoded, info);
Adecoded=zmat(Aencoded,info)

all(all(Adecoded==orig))
class(Adecoded)

all(all(Adecoded == orig));
class(Adecoded);

0 comments on commit 2cdc1b4

Please sign in to comment.