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

📄 corre.m

📁 一个实现循环卷积、因式分解的参考程序
💻 M
字号:
function [r,lag]=corre(x,string,id,y)
% x:the reference sequence
% y:the second sequence
% Compute the correlation sequence
if nargin<3
    error('Not enough input varibles')
end
if nargin==3
    y=x;
    n1=length(y)-1;
    n2=n1;
else
    n1=length(y)-1;
    n2=length(x)-1;
end
r = conv(x,fliplr(y));
lag= (-n1):n2;
%画图
figure(ceil(id/4)+2)
id=rem(id,4);
if id==0
    id=4;
end
subplot(220+id)
stem(lag,r);
xlabel('Lag index'); ylabel('Amplitude');
title(string)
v = axis;
axis([-n1 n2 v(3:end)]);

⌨️ 快捷键说明

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