comparison toolboxes/FullBNT-1.0.7/KPMtools/zipsave.m @ 0:e9a9cd732c1e tip

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