MAT.jl icon indicating copy to clipboard operation
MAT.jl copied to clipboard

duration support

Open aTrotier opened this issue 9 months ago • 5 comments

Hi, I have files from a motion databases which associates a motion matrice to a TimeStamp.

The timestamp parts is not loaded by MAT.jl Image

The matlab type is "duration"

aTrotier avatar Feb 13 '25 10:02 aTrotier

Cf. CompoundPeriod for a possible type to translate duration into: https://docs.julialang.org/en/v1/stdlib/Dates/#Dates-and-Time-Types

stemann avatar Feb 18 '25 12:02 stemann

Right now, MAT.jl returns an empty value. I have to dig into the package to see where to put the conversion

aTrotier avatar Feb 18 '25 13:02 aTrotier

@stemann so I tried to load the data as UInt32 an that gives me :

julia> vars["dur_1"]
6×1 Matrix{UInt32}:
 0xdd000000
 0x00000002
 0x00000001
 0x00000001
 0x00000001
 0x00000001

julia> Int.(ans)
6×1 Matrix{Int64}:
 3707764736
          2
          1
          1
          1
          1

No idea what to do with that to get that :

Image

Weirdly If I extract only one element of the TimeStamp I still get the same results...

aTrotier avatar Feb 19 '25 22:02 aTrotier

You may want to look into how duration is represented in the MAT-file - it looks like it could be a bit complicated: https://www.mathworks.com/help/coder/ug/define-duration-array-inputs.html

stemann avatar Feb 19 '25 23:02 stemann

I did it but no information about it.

I guess I have to reverse engineer it if I really want that possibility...

Le jeu. 20 févr. 2025, 00:43, Jesper Stemann Andersen < @.***> a écrit :

You may want to look into how duration is represented in the MAT-file - it looks like it could be a bit complicated: https://www.mathworks.com/help/coder/ug/define-duration-array-inputs.html

— Reply to this email directly, view it on GitHub https://github.com/JuliaIO/MAT.jl/issues/201#issuecomment-2670024702, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5P7O7EYED47P7LRN3LTG32QUJKPAVCNFSM6AAAAABXB2V7IOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZQGAZDINZQGI . You are receiving this because you authored the thread.Message ID: @.***> [image: stemann]stemann left a comment (JuliaIO/MAT.jl#201) https://github.com/JuliaIO/MAT.jl/issues/201#issuecomment-2670024702

You may want to look into how duration is represented in the MAT-file - it looks like it could be a bit complicated: https://www.mathworks.com/help/coder/ug/define-duration-array-inputs.html

— Reply to this email directly, view it on GitHub https://github.com/JuliaIO/MAT.jl/issues/201#issuecomment-2670024702, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5P7O7EYED47P7LRN3LTG32QUJKPAVCNFSM6AAAAABXB2V7IOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZQGAZDINZQGI . You are receiving this because you authored the thread.Message ID: @.***>

aTrotier avatar Feb 20 '25 00:02 aTrotier

We're working on class support, hopefully that will allow duration support soon as well: #205

matthijscox avatar Nov 14 '25 15:11 matthijscox

Reading of duration is supported now with the Dates.Millisecond type in v0.11

matthijscox avatar Nov 20 '25 14:11 matthijscox