0
I have a mistake in this role isempty
in Matlab, I need when it is empty through a matrix to make the condition after the if isempty
:
function bn_hat = my_descodificador_Hamming_v2(rn,N,H_Ham,n_cyc,k_cyc,simb_alfa)
rn = reshape(rn,n_cyc,N/k_cyc)';
bn_til = rem(rn*H_Ham',2);
sn_til = bi2de(bn_til,'right-msb')';
cn_hat = rn';
pos = find(sn_til>0);
pos_erro = nansum(simb_alfa(sn_til(pos)),1);
if isempty(pos_erro,[])
cn_hat(pos_erro+n_cyc*(pos-1)) = not( cn_hat(pos_erro+n_cyc) );
end
bn_hat = cn_hat(k_cyc:end,:)';
bn_hat = reshape(bn_hat',1,[]);
The mistake you make is this::
Eb/No = +0 dB :: errors = Error using isempty Too Many input Arguments.
Error in my_decode_Hamming_v2 (line 11) if isempty(pos_error,[])
Error in sim_FSK_incoherent (line 56) bn_hat = my_descodificador_Hamming_v2(cn_hat,N,H_Ham,n_cyc,k_cyc,simb_alfa);
Solved, thanks for the help.
– Sergio Nunes