求用MATLAB Simulink产生m序列和Gold序列的程序,谢谢了,急用
若以下回答无法解决问题,邀请你更新回答
1个回答
展开全部
function [mseq ] = mseries (coefficients);
len = length (coefficients) ;
L = 2^len - 1 ; %所需的移位寄存器的长度
registers = [zeros (1 ,len - 1) ,1 ] ; %初始寄存器内容
mseq (1) = registers (1) ;
for i = 2 :L
newregisters (1 :len - 1) = registers (2 :len) ;
newregisters ( len) = mod ( sum ( coefficients. 3
registers) ,2) ;
registers = newregisters ;
mseq (i) = registers (1) ;
end
len = length (coefficients) ;
L = 2^len - 1 ; %所需的移位寄存器的长度
registers = [zeros (1 ,len - 1) ,1 ] ; %初始寄存器内容
mseq (1) = registers (1) ;
for i = 2 :L
newregisters (1 :len - 1) = registers (2 :len) ;
newregisters ( len) = mod ( sum ( coefficients. 3
registers) ,2) ;
registers = newregisters ;
mseq (i) = registers (1) ;
end
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询