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

📄 writesparse.m

📁 压缩文件中是Error Correction Coding - Mathematical Methods and Algorithms(Wiley 2005)作者:(Todd K. Moon )的配
💻 M
字号:
function writesparse(A,fp)% function writesparse(A,fp)%% Write the binary matrix A into the file fp% in MacKay's sparse format% Todd Moon% Copyright 2004 by Todd K. Moon% Permission is granted to use this program/data% for educational/research only[m,n] = size(A);fprintf(fp,'%d %d\n',n,m);   % dimensions of Afprintf(fp,'%d %d\n',max(sum(A,1)),max(sum(A,2)));  % max column and row weightsfprintf(fp,'%d ',sum(A,1)); fprintf(fp,'\n');  % column weights (array)fprintf(fp,'%d ',sum(A,2)); fprintf(fp,'\n');  % row weights (array)for i=1:n  % write out the nonzero positions in each column  fprintf(fp,'%d ',find(A(:,i)));  fprintf(fp,'\n');endfor i=1:m  % write out the nonzero positions in each row  fprintf(fp,'%d ',find(A(i,:)));  fprintf(fp,'\n');end

⌨️ 快捷键说明

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