Entropy of zipped file

2 views (last 30 days)
Nat
Nat on 11 Dec 2014
Edited: Image Analyst on 11 Dec 2014
I was wondering.. Is it possible to read a zipped file and calculate its entropy? I don't know how to read/open the zip file.. But I am familiar with the function Entropy.

Answers (2)

Guillaume
Guillaume on 11 Dec 2014
Edited: Image Analyst on 11 Dec 2014
Use fread:
fid = fopen('example.zip', 'r');
a = fread(fid);
fclose(fid);
H = entropy(a);

Sean de Wolski
Sean de Wolski on 11 Dec 2014
doc unzip
doc untar
doc gunzip
Probably one of these will help.
  1 Comment
Image Analyst
Image Analyst on 11 Dec 2014
Nat's "Answer" to Sean moved here.
But I don't want to unzip the file. I just want to read it like that. something like:
a=readfile('example.zip');
H=entropy(a);

Sign in to comment.

Categories

Find more on Data Import and Export in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!