Hi,,how do I execute the do loop in matlab.I am explaining the problem below.

1 view (last 30 days)
I have a command.I want to execute it until the condition becomes false.How do I do that?
noise=(rand(1,length(H))<.3)*3 ; %%%channel model %%I am taking 3 as erasure bit
for i=1:1:length(noise)
if noise(i)==3
Codeword(i)=3;
else Codeword;
end
end
Codeword; %%%%%codeword with noise after passing through the channel
a=sum(Codeword==3)
H_dummy=zeros(size(H,1),size(H,2));
for i=1:1:size(H,1)
for j=1:1:size(H,2)
if Codeword(j)==3
if H(i,j)==1;
H_dummy(i,j)=3;
else H_dummy;
end
end
end
end
H_dummy ; %%%only erasures are kept for weight calculation
for i=1:1:size(H,1)
for j=1:1:size(H,2) %%%column
if Codeword(j)~=3
if H(i,j)==1
H(i,j)=Codeword(j);
end
end
end
end
for i=1:1:size(H,1)
for j=1:1:size(H,2)
if Codeword(j)==3
if H(i,j)==1
H(i,j)=0; %%%%eliminating nodes
end
end
end
end
H;
Check_node=mod(sum(H,2),2);
for i=1:1:size(H_dummy,1)
weight=sum(H_dummy(i,:)==3); %%%%this matrix is used to check weight row-wise (actually check nodes with degree one)
for j=1:1:size(H_dummy,2)
if weight==1
if H_dummy(i,j)==3;
Codeword(j)=Check_node(i);
end
end
end
end
This is my decoder for LDPC code.How do I iterate the same program several times so that I can recover more number of erasures.
Thanks in Advance

Answers (1)

秋月
秋月 on 26 Sep 2022
Do you have the LDPC simulation code over BEC channle . If you have ,can you give me your code to learn? Thank you in advance.

Community Treasure Hunt

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

Start Hunting!