| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Data Acquisition Toolbox |
| Contents | Index |
| Learn more about Data Acquisition Toolbox |
out = binvec2dec(bin)
bin | A binary vector. |
out | A double array. |
out = binvec2dec(bin) converts the binary vector bin to the equivalent decimal number and stores the result in out. All nonzero binary vector elements are interpreted as a 1.
A binary vector (binvec) is constructed with the least significant bit (LSB) in the first column and the most significant bit (MSB) in the last column. For example, the decimal number 23 is written as the binvec value [1 1 1 0 1].
To convert the binvec value [1 1 1 0 1] to a decimal value:
binvec2dec([1 1 1 0 1])
ans =
23![]() | analogoutput | clear | ![]() |

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 |