CAT2BIN converts categorical into binary data
each category of each column in D is converted into a logical column
B = cat2bin(C);
[B,BinLabel] = cat2bin(C,Label);
[B,BinLabel] = cat2bin(C,Label,MODE)
C categorical data
B binary data
Label description of each column in C
BinLabel description of each column in B
MODE default [], ignores NaN
'notIgnoreNAN' includes binary column for NaN
'IgnoreZeros' zeros do not get a separate category
'IgnoreZeros+NaN' zeros and NaN are ignored
example:
cat2bin([1;2;5;1;5]) results in
1 0 0
0 1 0
0 0 1
1 0 0
0 0 1
Package: nan