Matlab 7.3 support #1

Open
opened 2018-08-30 08:25:38 +00:00 by simmarn · 4 comments
simmarn commented 2018-08-30 08:25:38 +00:00 (Migrated from github.com)

Hi!

MatFileHandler works brilliantly with Matlab 5.0 mat files. But I need support for reading Matlab 7.0. Is that in the pipe?

Right now I get when trying to read:

Unhandled Exception: System.NotSupportedException: Unknown element.
   at MatFileHandler.DataElementReader.Read(BinaryReader reader)
   at MatFileHandler.MatFileReader.Read(BinaryReader reader)
   at MatFileHandler.MatFileReader.Read()
   at MatReaderTest.Program.Main(String[] args) in C:\Users\Martin Olausson\source\repos\MatReader\MatReader\Program.cs:line 28
Hi! MatFileHandler works brilliantly with Matlab 5.0 mat files. But I need support for reading Matlab 7.0. Is that in the pipe? Right now I get when trying to read: ``` Unhandled Exception: System.NotSupportedException: Unknown element. at MatFileHandler.DataElementReader.Read(BinaryReader reader) at MatFileHandler.MatFileReader.Read(BinaryReader reader) at MatFileHandler.MatFileReader.Read() at MatReaderTest.Program.Main(String[] args) in C:\Users\Martin Olausson\source\repos\MatReader\MatReader\Program.cs:line 28 ```
mahalex commented 2018-08-30 14:52:06 +00:00 (Migrated from github.com)

Thanks for your feedback!
I think Matlab 7.0 files are supported, as long as they only contain "ordinary" things like matrices, structure arrays, cell arrays, etc. However, reading Matlab "objects" (instances of user-defined Matlab classes) is not currently supported. The documentation for object storage seems scarce (I believe the official documentation is non-existent). Could you please share some file that you cannot import, and I'll take a closer look at it? This way we will be really sure what we're talking about.

Thanks for your feedback! I think Matlab 7.0 files are supported, as long as they only contain "ordinary" things like matrices, structure arrays, cell arrays, etc. However, reading Matlab "objects" (instances of user-defined Matlab classes) is not currently supported. The documentation for object storage seems scarce (I believe the official documentation is non-existent). Could you please share some file that you cannot import, and I'll take a closer look at it? This way we will be really sure what we're talking about.
simmarn commented 2018-08-30 18:52:11 +00:00 (Migrated from github.com)

Certainly. Here you have the Matlab 7.0 file I can not open. I do not think it contains any "objects".
https://simmarn.mydns.se/nextcloud/index.php/s/k3rA4Z4P4egiDqG

Certainly. Here you have the Matlab 7.0 file I can not open. I do not think it contains any "objects". https://simmarn.mydns.se/nextcloud/index.php/s/k3rA4Z4P4egiDqG
mahalex commented 2018-09-02 09:30:51 +00:00 (Migrated from github.com)

It looks like this file is actually in Matlab 7.3 format. It was produced by libmatio rather than Matlab (and it incorrectly states that it's Matlab 7.0 in the comment). Supporting 7.3 format would mean dealing with the horrible HDF5 format. A year ago (when I last researched HDF5) it seemed close to impossible. To my knowledge, there are still no native C# libraries for accessing HDF5 data, so I would have to rely on external C libraries, which doesn't sound exciting to me. Maybe the situation has changed since then, so I'll try to look into it again. In any case, I don't think there is a quick fix for that, sorry!

It looks like this file is actually in Matlab 7.3 format. It was produced by libmatio rather than Matlab (and it incorrectly states that it's Matlab 7.0 in the comment). Supporting 7.3 format would mean dealing with the horrible HDF5 format. A year ago (when I last researched HDF5) it seemed close to impossible. To my knowledge, there are still no native C# libraries for accessing HDF5 data, so I would have to rely on external C libraries, which doesn't sound exciting to me. Maybe the situation has changed since then, so I'll try to look into it again. In any case, I don't think there is a quick fix for that, sorry!
simmarn commented 2018-09-02 14:03:37 +00:00 (Migrated from github.com)

OK. Thanks for checking.

OK. Thanks for checking.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mahalex/MatFileHandler#1
No description provided.