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