de2bi.m
来自「《现代通信系统》Matlab源程序,一共10章的内容」· M 代码 · 共 21 行
M
21 行
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:
%
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?