matlab中的m序列问题function [out] = ms1(stg,taps,inidata,n)out = zeros(1,2^stg-1); fpos = zeros(stg,1); fpos(taps) = 1; for l = 1:2^stg-1out(1,l) = inidata(stg); num = mod(inidata*fpos,2); inidata(2:stg) = inidata(1:stg-1); inidata(1) = num; en

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/25 17:38:23
matlab中的m序列问题function [out] = ms1(stg,taps,inidata,n)out = zeros(1,2^stg-1); fpos = zeros(stg,1); fpos(taps) = 1; for l = 1:2^stg-1out(1,l) = inidata(stg); num = mod(inidata*fpos,2); inidata(2:stg) = inidata(1:stg-1); inidata(1) = num; en
xNAoe4S Gpԃ^C&kY&0vI-5 Ҵu֛ݽ~ 6j<~̷\"#iiiWNg#ì8Z+7%eB+(FC5)b()I0 ;9UCQ{ !Oe˪sCĐ(+ |]4m$/Y|ʗe MK'uޥf6s 15-:u M 6o6a˩_ 녌L4S, EE"~y@"#IC=CkoFanXa!;&kɱk6cXGrP-lo_[j~9=vw*:DB'# O{9Cv޵;,\1]+% dDwEgfkmҍƂQφLj,33X/wv(ys}:t}nAXotŕ'jnĆX; b<$;Z^

matlab中的m序列问题function [out] = ms1(stg,taps,inidata,n)out = zeros(1,2^stg-1); fpos = zeros(stg,1); fpos(taps) = 1; for l = 1:2^stg-1out(1,l) = inidata(stg); num = mod(inidata*fpos,2); inidata(2:stg) = inidata(1:stg-1); inidata(1) = num; en
matlab中的m序列问题
function [out] = ms1(stg,taps,inidata,n)
out = zeros(1,2^stg-1);
fpos = zeros(stg,1);
fpos(taps) = 1;
for l = 1:2^stg-1
out(1,l) = inidata(stg);
num = mod(inidata*fpos,2);
inidata(2:stg) = inidata(1:stg-1);
inidata(1) = num;
end
这是我从网上抄的程序,为什么每次提问的时候都会出现Input argument "stg" is undefined.
Error in ==> mxulie at 2
out = zeros(1,2^stg-1);
这样的错误?
我遇到了相同的问题,请问具体如何做?

matlab中的m序列问题function [out] = ms1(stg,taps,inidata,n)out = zeros(1,2^stg-1); fpos = zeros(stg,1); fpos(taps) = 1; for l = 1:2^stg-1out(1,l) = inidata(stg); num = mod(inidata*fpos,2); inidata(2:stg) = inidata(1:stg-1); inidata(1) = num; en
你肯定是把这个程序直接运行了,这是一个函数文件,是用来被其他地方调用的,应该懂吧?调用时需要给它输入4个参数,stg, taps, inidata, n.这是基础,你要想学matlab,不要着急运行程序,把基础的掌握了,剩下的就好上手了.