| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → EDA Simulator Link |
| Contents | Index |
| Learn more about EDA Link Simulator |
mvl2dec('mv_logic_string')
mvl2dec('mv_logic_string', signed)
mvl2dec('mv_logic_string') converts a multivalued logic string to a positive decimal. If mv_logic_string contains any character other than '0' or '1', NaN is returned. mv_logic_string must be a vector.
mvl2dec('mv_logic_string', signed) converts a multivalued logic string to a positive or a negative decimal. If signed is true, this function assumes the first character mv_logic_string(1) to be a signed bit of a 2s complement number. If signed is missing or false, the multivalued logic string becomes a positive decimal.
The following function call returns the decimal value 23:
mvl2dec('010111')
The following function call returns NaN:
mvl2dec('xxxxxx')
The following function call returns the decimal value -9:
mvl2dec('10111',true)![]() | matlabtbeval | nomatlabtb | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |