Convert multivalued logic to decimal
a multivalued logic character vector to a positive decimal. If mv_logic_char contains
any character other than
returned. mv_logic_char must be a vector.
mvl2dec('mv_logic_char', signed) converts
a multivalued logic character vector to a positive or a negative decimal.
If signed is true, this function assumes the
first character mv_logic_char(1) to be a signed
bit of a 2s complement number. If signed is missing
or false, the multivalued logic character vector becomes a positive
mvl2dec function accepts strings of binary digits and returns decimal integer values.
ans = 23
The following function call returns NaN because the binary digits are not either 1s and 0s.
ans = NaN
The second argument indicates that the string is a signed number.
ans = -9