Path: news.mathworks.com!newsfeed-00.mathworks.com!panix!bloom-beacon.mit.edu!llnews!53ab2750!not-for-mail
From: Peter Boettcher <boettcher@ll.mit.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Writing Binary file to reduce file size
References: <g62e8r$i37$1@fred.mathworks.com>
Message-ID: <muy4p6j89c6.fsf@G99-Boettcher.llan.ll.mit.edu>
Organization: MIT Lincoln Laboratory
User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/23.0.0 (gnu/linux)
Cancel-Lock: sha1:2BU+IiFzI4ueFXF5QgGf6uO+hT0=
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Lines: 19
Date: Mon, 21 Jul 2008 12:56:25 -0400
NNTP-Posting-Host: 155.34.163.114
X-Complaints-To: news@ll.mit.edu
X-Trace: llnews 1216658643 155.34.163.114 (Mon, 21 Jul 2008 12:44:03 EDT)
NNTP-Posting-Date: Mon, 21 Jul 2008 12:44:03 EDT
Xref: news.mathworks.com comp.soft-sys.matlab:480713



"Pete sherer" <tsh@abg.com> writes:

> Hi,
> Are there any example how to use Matlab to make the binary
> file of data. The goal is to reduce the file size as well as
> the accessing time to the file. Most of the data contain
> zero, so I hope binary file can be much smaller than the
> ascii file.

Yes indeed.

If you intend to load the data back into MATLAB, and only MATLAB, just
use "save" and "load".  The resulting file is "binary", though not in a
simple format.

If you wish to access the data from another programming language, see
the documentation for fopen, fwrite, fread, and fclose.

-Peter