Index exceeds the number of array elements (0) (Matlab)

1 回表示 (過去 30 日間)
Afluo Raoual
Afluo Raoual 2021 年 8 月 5 日
コメント済み: Rik 2021 年 8 月 6 日
Dear members
I'm working on a program that contains this part
% Decoding part
VCor_final=decode_irrwbf(Hc,rxn,M,N,max_ite);
V_final=VCor_final(N+1:end);
% Obtaining the initial sequence
uRec = [];
for i = 1
tmp = reshape(V_final(i,:), 2, length(V_final(i,:))/2);
uRec = [uRec tmp(1, :)];
U;
end
% BER
[n, ber] = biterr(uRec(1:M*L),U);
ber_sim = [ber_sim ber];
end
snr = 0:2:30;
figure;
semilogy(snr, ber_sim,'k*-','linewidth',1);
axis([0 30 0.000001 1]);
grid on;
xlabel('SNR(dB)');
ylabel('BER');
When running the program, step by step for the "decode_irrwbf" function it gives results of VCor_final. So it works with this function
But in the main program shows above, when running I got the error (Index exceeds the number of array elements (0)) and in the window command I got them empty
Can anyone tell me the problem and how to solve it please
  6 件のコメント
Afluo Raoual
Afluo Raoual 2021 年 8 月 6 日
編集済み: Afluo Raoual 2021 年 8 月 6 日
@Walter Roberson @Rik When I put breakpoint in the code at both Vcor_final and V_final I got results
It means it's not empty, but when I run all the code I found them empty
When I get out of this loop
They become empty
Rik
Rik 2021 年 8 月 6 日
We don't have your data, so we can't confirm what you see. So far we have no indication that any of your code would make V_final empty.
Since you have an extra end: are you running this in a loop? Is the last iteration perhaps resulting in an empty array?

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by