deci2bin.m

来自「802.15 dsss 物理协议层方针代码」· M 代码 · 共 18 行

M
18 行
字号
function y=deci2bin(x,l)
%Transformation function
%
% transfer the decimal data to binary data
%
% Arguments:   x - input decimal data
%                        l - the number of binary data
%Author:    Hantao Liu
%
%==============================================================
y=zeros(1,l);
i=1;
while x>=0 & i<=l
    y(i)=rem(x,2);
    x=(x-y(i))/2;
    i=i+1;
end
y=y(l:-1:1);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?