coinc.m

来自「vigenere密码解密的matlab实现」· M 代码 · 共 14 行

M
14
字号
function y = coinc(txt,n);% This function returns the number of matches between txt and txt % shifted by nxln=length(txt);x=[zeros(size(xln-n+1:xln)) txt(1:xln-n)]; %The zeros are at the beginning because I needed filler when doing the compare% One could wrap around the text, as in which case one would use % txt(xln-n+1:xln)v=(txt==x);y=sum(v);

⌨️ 快捷键说明

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