Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

run bunzip2 from matlab

712 views
Skip to first unread message

Jonathan Blythe

unread,
May 19, 2009, 10:03:02 AM5/19/09
to
I have been working with many files on Matlab, previously running code I wrote for a Mac platform, except now I'm trying to make the code compatible with the 2006b version on a windows xp machine. My trouble is that I am trying to run the bunzip2 script that is not available for windows machines. I would call this script in a Mac using this command:
%%%%
system(sprintf('bunzip2 %s',filename));
%%%%
I'd like to run an analogous command in Matlab to what I used on the Mac platform. I have got as far as downloading the exe file that will compress and decompress files from the windows xp command line (from the url below). Should I be able to execute this file from the matlab command line? Where should I put the exe file, and how should I call to it from matlab?
Thank you in advance.
jnb

http://www.bzip.org/

us

unread,
May 19, 2009, 10:10:04 AM5/19/09
to
"Jonathan Blythe" <jnbl...@gmail.com> wrote in message <guue6m$bu7$1...@fred.mathworks.com>...

i'm not sure the various zip-functions were available in r2006b, however, i'd give it a cheap try

help zip;

us

Jonathan Blythe

unread,
May 20, 2009, 10:36:01 AM5/20/09
to
Hi us,
I thought of that, and unfortunately the zip and unzip functions in Matlab 2006b do not work with the .bz2 files. Can you confirm that later versions of Matlab do have compatible .m files? I could easily upgrade, but prefer a cheaper solution at the moment.
Thanks,
Jonathan

us

unread,
May 20, 2009, 1:22:02 PM5/20/09
to
"Jonathan Blythe" <jnbl...@gmail.com> wrote in message <gv14gh$3pj$1...@fred.mathworks.com>...

in this case i'd do what you've done so far (and what we've done in the past when the zip-utilities were not yet available [we used the pkzip-family, which was still freely available at that time])...

% 1) download the wintel version from

http://www.bzip.org/downloads.html

% 2) put the executable anywhere in your os(!)-path

% 3) use it in your ML-file the way you did it in your mac-script...

com = sprintf('bunzip2 %s',filename);
[stat,res] = system(com);
% check STAT

us

Jonathan Blythe

unread,
May 20, 2009, 5:28:02 PM5/20/09
to
Thanks for your help!
by the way, I find this Matlab script works well for referencing this exe file.
%%%
system(sprintf('bzip2-105-x86-win32.exe %s',[filename,'%s -d']));
%%%

D chag

unread,
Oct 21, 2010, 2:50:09 PM10/21/10
to
"Jonathan Blythe" <jnbl...@gmail.com> wrote in message <gv1sl2$hs6$1...@fred.mathworks.com>...

Can someone please walk me through the process of unzipping .bz2 files through matlab? Where do I get the bunzip2.exe file? Where do I put it? What matlab script to run? Thanks.

0 new messages