⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fourbittoint.m

📁 在matlab下模擬hamming codeing的編解碼過程,碼率為7/11,提供初學者學習
💻 M
字号:
%FourBitToInt.m
function out=FourBitToInt(FourBitMatrix)
%Takes a binary matrix of 4 columns and any even number of rows and
%constructs a column matrix by creating an integer by concatenating two 
%consecutive rows in FourBitMatrix to form an 8 bit binary number and then
%converting that to a decimal. 
    [r,c]=size(FourBitMatrix);
    out=uint8(zeros(r/2,1));
    for i=1:r/2
        for j=1:4
             out(i)=out(i)+FourBitMatrix(2*i-1,j)*2^(8-j);
             out(i)=out(i)+FourBitMatrix(2*i,j)*2^(4-j);
        end
    end
end

⌨️ 快捷键说明

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