psifunc.m
来自「压缩文件中是Error Correction Coding - Mathemat」· M 代码 · 共 33 行
M
33 行
% Make a plot of the psi function used in density evolution% Todd K. Moon, May 6, 2004% Copyright 2004 by Todd K. Moon% Permission is granted to use this program/data% for educational/research onlyif(~exist('psi2')) mlist = 1:.25:10; %only need positive values: psi is odd psi = []; for m=mlist; s2 = 2*m; str=sprintf('tanh(x/2).*exp(-(x-(%g)).^2 ./(4*(%g)))/sqrt(4*pi*(%g))',... m,m,m); F = inline(str); Q = quad(F,m-10*s2,m+10*s2) psi = [psi Q]; end mlist2 = [-fliplr(mlist) 0 mlist]; psi2 = [-fliplr(psi) 0 psi];endclf;plot(mlist2,psi2);hold on;plot(mlist2,tanh(mlist2/2),'r--');h = legend('\Psi(x)','tanh(x)');set(gca,'fontsize',15)set(h,'fontsize',15);axis([-10 10 -1.5 1.5])xlabel('x');% print -dps psifunc.ps
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?