Error:Index in position 1 exceeds array bounds.

조회 수: 12 (최근 30일)
Skanda
Skanda 2024년 6월 23일
댓글: Matlab Pro 2024년 6월 24일
Code:
sum_parity=[];
llr=2;
check_node=cell(size(H,1),1);
Unrecognized function or variable 'H'.
for(i=1:size(H,1))
for(j=1:size(H,2))
if(H(i,j)==1)
check_node{i}=[check_node{i} j];
else
;
end;
end;
end;
Q=[];
for(i=1:size(H,1))
Q=[Q llr];
end;
for(interation=1:1000)
[ processed_llr ] = check_node_processing(Q, check_node);
Processed_llr_in_varibale_form=cell(size(H,2),1);
for(i=1:length(processed_llr))
temp=processed_llr{i};
for(j=1:size(temp,2))
Processed_llr_in_varibale_form{round(temp(2,j))}=[Processed_llr_in_varibale_form{round(temp(2,j))} [temp(1,j);i]];
end;
end;
for(i=1:length(Processed_llr_in_varibale_form))
temp=Processed_llr_in_varibale_form{i};
for(j=1:size(temp,2))
Q(i,temp(2,j))=sum(setdiff(temp(1,:), temp(1,j)));
end;
end;
for(i=1:size(Q,1))
for(j=1:size(Q,2))
Q(i,j)=Q(i,j)+llr(i);
end;
end;
P=[ ];
for(i=1:length(Processed_llr_in_varibale_form))
temp=Processed_llr_in_varibale_form{i};
P(i)=sum(temp(1,:));
end;
P=P+llr;
for(jj=1:length(P))
if(P(jj)>=0)
estimated_output(jj)=0;
else
estimated_output(jj)=1;
end;
end;
parity_mat=H*estimated_output';
sum_parity=[sum_parity sum(parity_mat) ];
if(sum(parity_mat)==0)
break;
break;
end;
end;
Error:
Error in ldpc_decoder (line 57)
P(i)=sum(temp(1,:));
  댓글 수: 2
Torsten
Torsten 2024년 6월 23일
편집: Torsten 2024년 6월 23일
We cannot execute your code because H is undefined. But my guess is that "temp" is an empty matrix.
Matlab Pro
Matlab Pro 2024년 6월 24일
even if H is defined - there is a call to "check_node_processing" function - which is not given.
Please supply all code needed in order to help you

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Error Detection and Correction에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by