Error:Index in position 1 exceeds array bounds.

15 views (last 30 days)
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 Comments
Torsten
Torsten on 23 Jun 2024
Edited: Torsten on 23 Jun 2024
We cannot execute your code because H is undefined. But my guess is that "temp" is an empty matrix.
Matlab Pro
Matlab Pro on 24 Jun 2024
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

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!