loadmatfile loads as uint8 logical hypermatrix and logical arrays in cells, instead of as booleans
@sgougeon)
Reported by Samuel GOUGEON (logical_bin_7.mat (474 bytes, application/octet-stream)
Logical variables saved from Octave 4.4.0 with the -7 option
BUG DESCRIPTION:
----------------
With the attached file created from Octave 4.4.0 with
ba = true
bv = rand(1,4)<0.5
bm = rand(2,3)<0.5
bh = rand(3,4,2)<0.5
save -binary -7 logical_bin_7.mat ba bv bm bh
clear ba bv bm bh
load logical_bin_6.mat
ba, bv, bm, bh % check
class(bh)
>> class(bh)
ans = logical
loadmatfile() yields:
In Scilab 5.5.2:
===============
-->clear ba bv bm bh
-->loadmatfile logical_bin_7.mat
-->ba,bv,bm,bh
ba =
T
bv =
T F F T
bm =
F T F
F F F
bh =
(:,:,1)
10^(-312) *
Inf - Inf Nan Nan
Inf Inf - Inf Nan
Inf Nan Inf - Inf
(:,:,2)
10^(-316) *
Inf - Inf Nan Nan
Nan Inf - Inf Nan
Nan Nan Inf - Inf
Scilab 6.0.1:
============
--> clear ba bv bm bh
--> loadmatfile logical_bin_7.mat
--> ba,bv,bm,bh
ba =
T <<<< OK
bv =
T F F T <<<< OK
bm =
F T F <<<< OK
F F F
bh =
(:,:,1)
1 1 0 1 <<<< STILL THE BUG: %T|%F components expected
1 0 1 1
0 0 0 1
(:,:,2)
1 1 1 1
0 0 0 0
1 0 1 1
ERROR LOG:
----------
none. Wrong type of output
HOW TO REPRODUCE THE BUG:
-------------------------
clear ba bv bm bh
loadmatfile logical_bin_7.mat
ba,bv,bm,bh
type(bh)==4