Compressing file into zip file

13 views (last 30 days)
KIM QUOC ANH
KIM QUOC ANH on 21 Nov 2018
Answered: Jan on 21 Nov 2018
Suppose I have 5 Matlab files (naming 1.m to 5.m)
I want to compress 2.m and 3.m into 1 zip file; 4.m and 5.m into another zip file
Then compress all 3 files (1.m and 2 compressed files above) into 1 zip file
So the final result is 1 zip file that contains 3 files, 2 of which are comprised of 2 files
Does anyone know how to do so ?

Answers (1)

Jan
Jan on 21 Nov 2018
This is easy with the GUI of e.g. 7zip. But do you want to do this inside Matlab? Then what exactly is the problem?
zip('first.zip', {'2.m', '3.m'});
zip('second.zip', {'4.m', '5.m'});
zip('third.zip', {'1.m', 'first.zip', 'second.zip'});

Community Treasure Hunt

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

Start Hunting!