I have a MAT file containing some variables that store string vectors. Below is one example of such a variable:
"HY0802"
"HY0807"
"HY0811"
"HY0812"
"HY0825"
When I use the MAT.jl package to read the info out, I’m encountering multiple errors. I wonder if anyone knows an alternative way of getting the strings out?
Below is my code:
using MAT
File1 = matopen("/path/test.mat");
A = read(File1, "A");
close(File1);
Here are the errors. My data does not contain headers. Obviously strings are making things complicated.
LoadError: zlib error: incorrect header check (code: -3)
Stacktrace:
[1] **changemode!(** stream::TranscodingStreams.TranscodingStream{CodecZlib.ZlibDecompressor, IOStream}, newmode::Symbol **)**
@ TranscodingStreams ~/.julia/packages/TranscodingStreams/IVlnc/src/stream.jl:717
[2] **callprocess(** stream::TranscodingStreams.TranscodingStream{CodecZlib.ZlibDecompressor, IOStream}, inbuf::TranscodingStreams.Buffer, outbuf::TranscodingStreams.Buffer **)**
@ TranscodingStreams ~/.julia/packages/TranscodingStreams/IVlnc/src/stream.jl:649
[3] **fillbuffer(** stream::TranscodingStreams.TranscodingStream{CodecZlib.ZlibDecompressor, IOStream}; eager::Bool **)**
@ TranscodingStreams ~/.julia/packages/TranscodingStreams/IVlnc/src/stream.jl:577
[4] **fillbuffer**
@ ~/.julia/packages/TranscodingStreams/IVlnc/src/stream.jl:564 [inlined]
[5] **eof(** stream::TranscodingStreams.TranscodingStream{CodecZlib.ZlibDecompressor, IOStream} **)**
@ TranscodingStreams ~/.julia/packages/TranscodingStreams/IVlnc/src/stream.jl:188
[6] **unsafe_read(** stream::TranscodingStreams.TranscodingStream{CodecZlib.ZlibDecompressor, IOStream}, output::Ptr{UInt8}, nbytes::UInt64 **)**
@ TranscodingStreams ~/.julia/packages/TranscodingStreams/IVlnc/src/stream.jl:356
[7] **unsafe_read**
@ ./io.jl:724 [inlined]
[8] **read!**
@ ./io.jl:736 [inlined]
[9] **read_bswap(** f::TranscodingStreams.TranscodingStream{CodecZlib.ZlibDecompressor, IOStream}, swap_bytes::Bool, #unused#::Type{UInt8}, dim::Int64 **)**
@ MAT.MAT_v5 ~/.julia/packages/MAT/f523T/src/MAT_v5.jl:86
[10] **read_element(** f::TranscodingStreams.TranscodingStream{CodecZlib.ZlibDecompressor, IOStream}, swap_bytes::Bool, #unused#::Type{UInt8} **)**
@ MAT.MAT_v5 ~/.julia/packages/MAT/f523T/src/MAT_v5.jl:124
[11] **getvarnames(** matfile::MAT.MAT_v5.Matlabv5File **)**
@ MAT.MAT_v5 ~/.julia/packages/MAT/f523T/src/MAT_v5.jl:393
[12] **read(** matfile::MAT.MAT_v5.Matlabv5File, varname::String **)**
@ MAT.MAT_v5 ~/.julia/packages/MAT/f523T/src/MAT_v5.jl:408