Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

dec2mvl

Convert decimal integer to binary character vector

Syntax

dec2mvl(d)
dec2mvl(d,n)

Description

dec2mvl(d) returns the binary representation of d as a multivalued logic character vector. d must be an integer smaller than 2^52.

dec2mvl(d,n) produces a binary representation with at least n bits.

Examples

collapse all

The dec2mvl function returns strings of binary digits.

dec2mvl(23)
ans =

    '10111'

dec2mvl(-23)
ans =

    '101001'

The second argument specifies the minimum number of bits represented in the string.

dec2mvl(-23,8)
ans =

    '11101001'

See Also

Introduced in R2008a

Was this topic helpful?