diff --git a/src/MAT_HDF5.jl b/src/MAT_HDF5.jl index 3001e70..aa2c57f 100644 --- a/src/MAT_HDF5.jl +++ b/src/MAT_HDF5.jl @@ -169,6 +169,9 @@ function m_read(dset::HDF5Dataset) end end return out + elseif !haskey(str2type_matlab,mattype) + @warn "MATLAB $mattype values are currently not supported" + return missing end # Regular arrays of values @@ -272,7 +275,7 @@ Return a list of variables in an opened Matlab file. See `matopen`. """ -names(f::MatlabHDF5File) = filter!(x->x != "#refs#", names(f.plain)) +names(f::MatlabHDF5File) = filter!(x -> x!="#refs#" && x!="#subsystem#", names(f.plain)) """ exists(matfile_handle, varname) -> Bool diff --git a/test/read.jl b/test/read.jl index db27d60..e1f388b 100644 --- a/test/read.jl +++ b/test/read.jl @@ -212,3 +212,14 @@ let objtestfile = "figure.fig" @test vars["hgS_070000"]["handle"] == 1.0 @test vars["hgS_070000"]["type"] == "figure" end + +# test reading file containing Matlab table and datetime objects +# since we don't support these objects, just make sure that there are no errors +# reading the file and that the variables are there and replaced with `missing` +let objtestfile = "struct_table_datetime.mat" + vars = matread(joinpath(dirname(@__FILE__), "v7.3", objtestfile))["s"] + @test "testTable" in keys(vars) + @test ismissing(vars["testTable"]) + @test "testDatetime" in keys(vars) + @test ismissing(vars["testDatetime"]) +end diff --git a/test/v7.3/struct_table_datetime.mat b/test/v7.3/struct_table_datetime.mat new file mode 100644 index 0000000..9082308 Binary files /dev/null and b/test/v7.3/struct_table_datetime.mat differ