wolffd@0
|
1 %ZIPSAVE Save data in compressed format
|
wolffd@0
|
2 %
|
wolffd@0
|
3 % zipsave( filename, data )
|
wolffd@0
|
4 % filename: string variable that contains the name of the resulting
|
wolffd@0
|
5 % compressed file (do not include '.zip' extension)
|
wolffd@0
|
6 % pkzip25.exe has to be in the matlab path. This file is a compression utility
|
wolffd@0
|
7 % made by Pkware, Inc. It can be dowloaded from: http://www.pkware.com
|
wolffd@0
|
8 % This function was tested using 'PKZIP 2.50 Command Line for Windows 9x/NT'
|
wolffd@0
|
9 % It is important to use version 2.5 of the utility. Otherwise the command line below
|
wolffd@0
|
10 % has to be changed to include the proper options of the compression utility you
|
wolffd@0
|
11 % wish to use.
|
wolffd@0
|
12 % This function was tested in MATLAB Version 5.3 under Windows NT.
|
wolffd@0
|
13 % Fernando A. Brucher - May/25/1999
|
wolffd@0
|
14 %
|
wolffd@0
|
15 % Example:
|
wolffd@0
|
16 % testData = [1 2 3; 4 5 6; 7 8 9];
|
wolffd@0
|
17 % zipsave('testfile', testData);
|
wolffd@0
|
18 %
|
wolffd@0
|
19 % Modified by Kevin Murphy, 26 Feb 2004, to use winzip
|
wolffd@0
|
20 %------------------------------------------------------------------------
|
wolffd@0
|
21
|
wolffd@0
|
22 function zipsave( filename, data )
|
wolffd@0
|
23
|
wolffd@0
|
24 %--- Save data in a temporary file in matlab format (.mat)---
|
wolffd@0
|
25
|
wolffd@0
|
26 eval( ['save ''', filename, ''' data'] )
|
wolffd@0
|
27
|
wolffd@0
|
28
|
wolffd@0
|
29 %--- Compress data by calling pkzip (comand line command) ---
|
wolffd@0
|
30 % Options used:
|
wolffd@0
|
31 % 'add' = add compressed files to the resulting zip file
|
wolffd@0
|
32 % 'silent' = no console output
|
wolffd@0
|
33 % 'over=all' = overwrite files
|
wolffd@0
|
34
|
wolffd@0
|
35 %eval( ['!pkzip25 -silent -add -over=all ', filename, '.zip ', filename,'.mat'] )
|
wolffd@0
|
36 eval( ['!zip ', filename, '.zip ', filename,'.mat'] )
|
wolffd@0
|
37
|
wolffd@0
|
38 %--- Delete temporary matlab format file ---
|
wolffd@0
|
39
|
wolffd@0
|
40 delete( [filename,'.mat'] )
|
wolffd@0
|
41
|
wolffd@0
|
42
|