codeshift.m

来自「GPS的matlab程序」· M 代码 · 共 20 行

M
20
字号
function [out]=codeshift(in_code , offset);
n1=5000;
n2=16367;
n=n2;
if offset==0;
    out=in_code;
end
if offset>0;  % shift right
 ca_temp(1,1:offset)=in_code(1,n-offset+1:n);
 in_code(1,offset+1:n)=in_code(1,1:n-offset);
 in_code(1,1:offset)=ca_temp(1,1:offset);
 out=in_code;
end
if offset<0;   %shift left
    offset=-offset;
 ca_temp(1,1:offset)=in_code(1,1:offset);
 in_code(1,1:n-offset)=in_code(1,offset+1:n);
 in_code(1,n-offset+1:n)=ca_temp(1,1:offset);
 out=in_code;
end

⌨️ 快捷键说明

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