makeman.m

来自「This is a collection of m-files I create」· M 代码 · 共 18 行

M
18
字号
%makeMan(in)
%   This function creates a random sequence of 'in' bits valued at 0 and 1,
%   that meet a Manchester code, that is, that the only possible combinations
%   of two bits are '10' and '11'.  This is an NRZI code.

function out = makeMan(in)

if mod(in,2) == 1
    in = in + 1;
end

man = ones(1,in);
data = makeNRZ(in/2);
for i = 1:length(data)
    man(2*i) = data(i);
end

out = man;

⌨️ 快捷键说明

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