de2bi

de2bi - functionb=de2bi(varargin)...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
function b = de2bi(varargin)   %DE2BI Convert decimal numbers to binary numbers.   %   B = DE2BI(D) converts a nonnegative integer decimal vector D to a binary   %   matrix B. Each row of the binary matrix B corresponds to one element of D.   %   The default orientation of the of the binary output is Right-MSB; the first   %   element in B represents the lowest bit.   %   %   In addition to the vector input, three optional parameters can be given:   %   %   B = DE2BI(. ..,N) uses N to define how many digits (columns) are output.   %   %   B = DE2BI(. ..,N,P) uses P to define which base to convert the decimal   %   elements to.   %   %   B = DE2BI(. ..,FLAG) uses FLAG to determine the output orientation.  FLAG   %   has two possible values, 'right-msb' and 'left-msb'.  Giving a 'right-msb'   %   FLAG does not change the function's default behavior.  Giving a 'left-msb'   %   FLAG flips the output orientation to display the MSB to the left.   %   %   Examples:   %    D = [12; 5];   %   %    B = de2bi(D)                   B = de2bi(D,5)   %   B =                             B =   %        0     0     1     1             0     0     1     1     0   %        1     0     1     0             1     0     1     0     0   %   %    T = de2bi(D,[],3)              B = de2bi(D,5,'left-msb')   %   T =                             B =  
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/15/2011 for the course EE 150 at USC.

Page1 / 6

de2bi - functionb=de2bi(varargin)...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online