Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't correctly convert datetime type #133

Open
henry2004y opened this issue Dec 17, 2019 · 5 comments
Open

Can't correctly convert datetime type #133

henry2004y opened this issue Dec 17, 2019 · 5 comments

Comments

@henry2004y
Copy link

Hi,

I recently found that the datetime type in Matlab cannot be correctly read in Julia. For example, in Matlab

t = datetime('now','TimeZone','local','Format','d-MMM-y HH:mm:ss Z')
save('test.mat', t)

In Matlab it has the following display

 datetime

   17-Dec-2019 10:25:30 -0500

Then in Julia,

using MAT
vars = matread("test.mat")

It showed

Dict{String,Any} with 2 entries:
  "__opaque__" => Dict{String,Any}("s1"=>Int8[77, 67, 79, 83],"arr"=>("", UInt32[0xdd000000; 0x00000002; … ; 0x00000001; 0x00000001]),"s0"=>Int8[116],"s2"=>Int8[1…
  ""           => UInt8[0x00 0x01 … 0x00 0x00]

Anybody knows how to fix this? Thanks!

@StefanPofahl
Copy link

I can confirm, the bug is still there, tested with Matlab v2018b.
Where do you see the problem? In module "HDF5",
or in module "mat"?

@StefanPofahl
Copy link

StefanPofahl commented May 11, 2020

I will have a closer look, what happens, if I export in different mat-formats, like -v7

@StefanPofahl
Copy link

I have the impression it is a module "HDF5" issue, see:
issue 626

@jebej
Copy link
Contributor

jebej commented Jul 7, 2020

Could you try with the branch from this PR to see if you can load the file? It won't make any unsupported types work, but at least the rest of the file will be readable.

In julia:

]add https://github.com/jebej/MAT.jl.git#patch-1

@wsshin
Copy link

wsshin commented Sep 7, 2022

It showed

Dict{String,Any} with 2 entries:
  "__opaque__" => Dict{String,Any}("s1"=>Int8[77, 67, 79, 83],"arr"=>("", UInt32[0xdd000000; 0x00000002; … ; 0x00000001; 0x00000001]),"s0"=>Int8[116],"s2"=>Int8[1…
  ""           => UInt8[0x00 0x01 … 0x00 0x00]

I have a related question. When I load a .mat file using MAT.jl, I see that some entries are precisely in the format of the value of __opaque__ above. In my case, the entry has the following format:

Dict{String, Any} with 4 entries:
  "s1"  => Int8[77, 67, 79, 83]
  "arr" => ("", UInt32[0xdd000000; 0x00000002; … ; 0x00000001; 0x00000001;;])
  "s0"  => Int8[]
  "s2"  => Int8[112, 111, 105, 110, 116, 67, 108, 111, 117, 100]

In MATLAB, this entry is stored as a pointCloud (see MATLAB documentation) that has several fields, most importantly Location: an N-by-3 matrix containing 3D coordinates of N points.

Is there a way to decode the above entry to retrieve the Location information? I am wondering if the value corresponding to the "arr" key is some kind of pointers for the pointCloud fields.

Potentially related to #23.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants