wolffd@0
|
1 %ZIPLOAD Load compressed data file created with ZIPSAVE
|
wolffd@0
|
2 %
|
wolffd@0
|
3 % [data] = zipload( filename )
|
wolffd@0
|
4 % filename: string variable that contains the name of the
|
wolffd@0
|
5 % compressed file (do not include '.zip' extension)
|
wolffd@0
|
6 % Use only with files created with 'zipsave'
|
wolffd@0
|
7 % pkzip25.exe has to be in the matlab path. This file is a compression utility
|
wolffd@0
|
8 % made by Pkware, Inc. It can be dowloaded from: http://www.pkware.com
|
wolffd@0
|
9 % Or directly from ftp://ftp.pkware.com/pk250c32.exe, for the Windows 95/NT version.
|
wolffd@0
|
10 % This function was tested using 'PKZIP 2.50 Command Line for Windows 9x/NT'
|
wolffd@0
|
11 % It is important to use version 2.5 of the utility. Otherwise the command line below
|
wolffd@0
|
12 % has to be changed to include the proper options of the compression utility you
|
wolffd@0
|
13 % wish to use.
|
wolffd@0
|
14 % This function was tested in MATLAB Version 5.3 under Windows NT.
|
wolffd@0
|
15 % Fernando A. Brucher - May/25/1999
|
wolffd@0
|
16 %
|
wolffd@0
|
17 % Example:
|
wolffd@0
|
18 % [loadedData] = zipload('testfile');
|
wolffd@0
|
19 %--------------------------------------------------------------------
|
wolffd@0
|
20
|
wolffd@0
|
21 function [data] = zipload( filename )
|
wolffd@0
|
22
|
wolffd@0
|
23 %--- Decompress data file by calling pkzip (comand line command) ---
|
wolffd@0
|
24 % Options used:
|
wolffd@0
|
25 % 'extract' = decompress file
|
wolffd@0
|
26 % 'silent' = no console output
|
wolffd@0
|
27 % 'over=all' = overwrite files
|
wolffd@0
|
28
|
wolffd@0
|
29 %eval( ['!pkzip25 -extract -silent -over=all ', filename, '.zip'] )
|
wolffd@0
|
30 eval( ['!pkzip25 -extract -silent -over=all ', filename, '.zip'] )
|
wolffd@0
|
31
|
wolffd@0
|
32
|
wolffd@0
|
33 %--- Load data from decompressed file ---
|
wolffd@0
|
34 % try, catch takes care of cases when pkzip fails to decompress a
|
wolffd@0
|
35 % valid matlab format file
|
wolffd@0
|
36
|
wolffd@0
|
37 try
|
wolffd@0
|
38 tmpStruc = load( filename );
|
wolffd@0
|
39 data = tmpStruc.data;
|
wolffd@0
|
40 catch, return, end
|
wolffd@0
|
41
|
wolffd@0
|
42
|
wolffd@0
|
43 %--- Delete decompressed file ---
|
wolffd@0
|
44
|
wolffd@0
|
45 delete( [filename,'.mat'] )
|
wolffd@0
|
46
|
wolffd@0
|
47
|