Skip to content

BitVectors of length 1 are saved as scalars not arrays #163

@bjarthur

Description

@bjarthur
julia> using MAT

julia> matwrite("foo.mat", Dict("x"=>trues(1)))

julia> matread("foo.mat")
Dict{String, Any} with 1 entry:
  "x" => true

julia> matwrite("foo.mat", Dict("x"=>trues(2)))

julia> matread("foo.mat")
Dict{String, Any} with 1 entry:
  "x" => Bool[1, 1]

the workaround:

julia> matwrite("foo.mat", Dict("x"=>convert(Array{Any}, trues(1))))

julia> matread("foo.mat")
Dict{String, Any} with 1 entry:
  "x" => Any[true]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions