Open bjarthur opened 2 years ago
The behavior of the existing API is correct.
Generating test mat file in julia:
matwrite("ju.mat",
Dict(
"x1"=>trues(1),
"x2"=>trues(2),
"x3"=>convert(Array{Any}, trues(1))
))
Read the test mat file in MATLAB:
>> clear
>> load('ju.mat')
>> x1
x1 =
logical
1
>> x2
x2 =
2×1 logical array
1
1
>> x3
x3 =
1×1 cell array
{[1]}
Write mat file in MATLAB:
>> clear
>> m1 = logical([1])
m1 =
logical
1
>> m2 = logical([1; 1])
m2 =
2×1 logical array
1
1
>> m3 = logical([1 1])
m3 =
1×2 logical array
1 1
>> m4 = {1}
m4 =
1×1 cell array
{[1]}
>> m5 = {logical(1)}
m5 =
1×1 cell array
{[1]}
>> save('m.mat')
Read mat file in julia:
julia> matread("m.mat")
Dict{String, Any} with 5 entries:
"m3" => Bool[1 1]
"m2" => Bool[1; 1]
"m4" => Any[1.0]
"m5" => Any[true]
"m1" => true
the workaround: