Quantcast

MAT files saved much larger then expected

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

MAT files saved much larger then expected

Mark popov
Hi,

I'm accustomed to Matlab, using it for around 12 years, and now started using Octave as well.

I've noticed something strange - saving .mat files, might result with much higher size than expected.
For example, saving a .mat file which contains a single struct of ~380 cells, each one's size of ~1MB, results with an overall file size of 1GB (instead of just 380MB).
The size of the RAM memory actually seems OK, only when writing to the hard-drive its size explodes.
Furthermore, loading it takes considerable amount of time, and it's much more efficient to load the same data from distributed 400 different mat files.

Thanks in advance,
Mark
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MAT files saved much larger then expected

Mike Miller-4
On Thu, Apr 13, 2017 at 01:05:51 -0700, Mark popov wrote:

> Hi,
>
> I'm accustomed to Matlab, using it for around 12 years, and now started
> using Octave as well.
>
> I've noticed something strange - saving .mat files, might result with much
> higher size than expected.
> For example, saving a .mat file which contains a single struct of ~380
> cells, each one's size of ~1MB, results with an overall file size of 1GB
> (instead of just 380MB).
> The size of the RAM memory actually seems OK, only when writing to the
> hard-drive its size explodes.
> Furthermore, loading it takes considerable amount of time, and it's much
> more efficient to load the same data from distributed 400 different mat
> files.

Did you perhaps forget to include the -mat option? You may have assumed
that would be the default format, but it is not. See "help save".

  save file1.mat        ## file1.mat is Octave text format
  save -mat file2.mat   ## file2.mat is Matlab binary format

--
mike

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MAT files saved much larger then expected

Mark popov
Hi Mike,

Thanks, you were right, it made the difference.  
:)

Mark


On Thu, Apr 13, 2017 at 6:33 PM, Mike Miller-4 [via Octave] <[hidden email]> wrote:
On Thu, Apr 13, 2017 at 01:05:51 -0700, Mark popov wrote:

> Hi,
>
> I'm accustomed to Matlab, using it for around 12 years, and now started
> using Octave as well.
>
> I've noticed something strange - saving .mat files, might result with much
> higher size than expected.
> For example, saving a .mat file which contains a single struct of ~380
> cells, each one's size of ~1MB, results with an overall file size of 1GB
> (instead of just 380MB).
> The size of the RAM memory actually seems OK, only when writing to the
> hard-drive its size explodes.
> Furthermore, loading it takes considerable amount of time, and it's much
> more efficient to load the same data from distributed 400 different mat
> files.
Did you perhaps forget to include the -mat option? You may have assumed
that would be the default format, but it is not. See "help save".

  save file1.mat        ## file1.mat is Octave text format
  save -mat file2.mat   ## file2.mat is Matlab binary format

--
mike

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave



If you reply to this email, your message will be added to the discussion below:
http://octave.1599824.n4.nabble.com/MAT-files-saved-much-larger-then-expected-tp4682834p4682842.html
To unsubscribe from MAT files saved much larger then expected, click here.
NAML

Loading...