2 langxiangan71821 langxiangan71821 于 2016.04.16 16:54 提问

【MATLAB】未定义函数或变量 "d_k"

function y = rsc_encode(g, x, end1)
[n,K] = size(g);
m = K - 1;
if end1>0
L_info = length(x);
L_total = L_info + m;
else
L_total = length(x);
L_info = L_total - m;
end

state = zeros(1,m);

for i = 1:L_total
if end10 & i<=L_info)

  d_k = x(1,i);

elseif end1>0 & i>L_info

  d_k = rem( g(1,2:K)*state', 2 );

end

a_k = rem( g(1,:)*[d_k state]', 2 );

[output_bits, state] = encode_bit(g, a_k, state);

output_bits(1,1) = d_k;

y(n*(i-1)+1:n*i) = output_bits;

end

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!