Matlab (.mat) files format

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Matlab (.mat) files format

dariodematties
Hello People,

I am working in a cluster, then (at least for now) I am obliged to use
matlab.
When I save .mat files in octave, it is pretty easy to edit them with any
editor you have (like vim).
I manipulate those files with c++ programs in order to interact with octave
and with its visualization capabilities, analysis tools, computations, etc.
Now, using matlab I have realized that when you want to save a mat file and
then you try to edit it,
the characters in the in it are a kind of mess.
Why is that? Compression?
And -the most important point- How can I avoid it and save the files in a
the way octave saves them?

I have try to save them without compression, but the option seems to be not
recognized:

>> save AudioVector.mat a -v7.3 -nocompression
Error using save
Unknown command option.

The version of matlab available is

>> ver
----------------------------------------------------------------------------------------------------
MATLAB Version: 8.6.0.267246 (R2015b)

Operating System: Linux 2.6.32-696.10.3.el6.x86_64 #1 SMP Thu Sep 21
12:12:50 EDT 2017 x86_64
Java Version: Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot(TM)
64-Bit Server VM mixed mode
----------------------------------------------------------------------------------------------------
MATLAB                                                Version 8.6        
(R2015b)
Curve Fitting Toolbox                                 Version 3.5.2      
(R2015b)
Image Processing Toolbox                              Version 9.3        
(R2015b)
Parallel Computing Toolbox                            Version 6.7        
(R2015b)

Thanks!



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html

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

Re: Matlab (.mat) files format

siko1056
dariodematties wrote

> Hello People,
>
> I am working in a cluster, then (at least for now) I am obliged to use
> matlab.
> When I save .mat files in octave, it is pretty easy to edit them with any
> editor you have (like vim).
> I manipulate those files with c++ programs in order to interact with
> octave
> and with its visualization capabilities, analysis tools, computations,
> etc.
> Now, using matlab I have realized that when you want to save a mat file
> and
> then you try to edit it,
> the characters in the in it are a kind of mess.
> Why is that? Compression?
> And -the most important point- How can I avoid it and save the files in a
> the way octave saves them?
>
> I have try to save them without compression, but the option seems to be
> not
> recognized:
>
>>> save AudioVector.mat a -v7.3 -nocompression
> Error using save
> Unknown command option.
>
> The version of matlab available is
>
>>> ver
> ----------------------------------------------------------------------------------------------------
> MATLAB Version: 8.6.0.267246 (R2015b)
>
> Operating System: Linux 2.6.32-696.10.3.el6.x86_64 #1 SMP Thu Sep 21
> 12:12:50 EDT 2017 x86_64
> Java Version: Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot(TM)
> 64-Bit Server VM mixed mode
> ----------------------------------------------------------------------------------------------------
> MATLAB                                                Version 8.6        
> (R2015b)
> Curve Fitting Toolbox                                 Version 3.5.2      
> (R2015b)
> Image Processing Toolbox                              Version 9.3        
> (R2015b)
> Parallel Computing Toolbox                            Version 6.7        
> (R2015b)
>
> Thanks!

Octave uses the `-text` flag [1] by default when calling `save`.  This
output format is not available in Matlab.  Instead  Matlab uses a binary
file output by default.

Append the `-ascii` flag [1,2] in Octave and Matlab to create textual
interchangeable .mat files.  This format is less verbose than `-text` (no
header information is included etc.) but the files remain editable.

HTH, Kai

[1] https://www.gnu.org/software/octave/doc/interpreter/XREFsave
[2] https://www.mathworks.com/help/matlab/ref/save.html#inputarg_fmt



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html

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

Re: Matlab (.mat) files format

dariodematties
Thanks siko1056,


siko1056 wrote
> Octave uses the `-text` flag [1] by default when calling `save`.  This
> output format is not available in Matlab.  Instead  Matlab uses a binary
> file output by default.

That's a shame, I think I'll have to install Octave.
I have coded a great deal of libraries for reading and writing .mat files
in the format used by octave. I guess that if there is no way to make matlab
to write
files in the same format than octave, then I would have to install octave in
the home space
on the server.

Thanks a lot



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html

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

Re: Matlab (.mat) files format

Juan Pablo Carbajal-2
On Sat, Nov 18, 2017 at 7:02 PM, dariodematties
<[hidden email]> wrote:

> Thanks siko1056,
>
>
> siko1056 wrote
>> Octave uses the `-text` flag [1] by default when calling `save`.  This
>> output format is not available in Matlab.  Instead  Matlab uses a binary
>> file output by default.
>
> That's a shame, I think I'll have to install Octave.
> I have coded a great deal of libraries for reading and writing .mat files
> in the format used by octave. I guess that if there is no way to make matlab
> to write
> files in the same format than octave, then I would have to install octave in
> the home space
> on the server.
>
> Thanks a lot
>
Great! Also if you find your tools useful do not hesitate to share!

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