[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Octave saves variable in Matlab format in large size
From: |
David Bateman |
Subject: |
Re: Octave saves variable in Matlab format in large size |
Date: |
Fri, 09 Feb 2007 13:36:49 +0100 |
User-agent: |
Thunderbird 1.5.0.7 (X11/20060921) |
Muthiah Annamalai wrote:
> On Fri, 2007-02-09 at 02:26 -0500, Ge Baolai wrote:
>
>> Hi,
>>
>> Just noticed that variables saved with '-mat-binary' option in Octave
>> result in larger file size than Matlab's. For example,
>>
>> In Matlab (ver. 7.0)
>> z = zeros(5000,999,3);
>> save 'z.mat' z
>> generates a file of size 53K bytes, which seems to contain only a
>> minimum data.
>>
>> While in Octave, the command
>> z = zeros(5000,999,3);
>> save '-mat-binary' z.mat z
>> results in a file of size 119,880,208 bytes, the full size of 5000 x 999 x 3
>> doubles.
>>
>> Any comments?
>>
>>
> I am going to risk an explanation here. Octave is trying to be
> compatible to Matlab, might seem to be the biggest bottleneck here.
> Generally developers work in limited information, closed standards,
> and mostly sort of produce compatibility from whatever little
> documentation that exist, when nobody has time to reverse engineer the
> nuts and bolts.
>
In fact Muthu Mathworks has fairly well documentation the file format..
I dislike their design choices of partially zipping the file rather than
just zipping the whole thing as this essentially forced me to have to
have a copy of the zipped data in memory for octave to be able to unzip.
However, the format itself is well documented, check
http://www.mathworks.com/access/helpdesk/help/pdf_doc/matlab/matfile_format.pdf
> Octave could simply use efficient storage with some/any compression
> formats (bzip, gzip etc) but then people could complain of this not
> being compatible!
>
>
Octave does have zlib compression of its data for all formats (even
matlab's though matlab won't read it afterwards) with the "-z" flag. It
doesn't work for the HDF file formats either, as an external library is
used there...
> So its the lesser of the devils, IMHO.
>
>
I suppose now that v7 is largely deployed it would be better to have
"-mat" and "-mat-binary" use the v7 format if that what everyone really
wants..
D.
--
David Bateman address@hidden
Motorola Labs - Paris +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob)
91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax)
The information contained in this communication has been classified as:
[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary