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

2 次查看(过去 30 天)
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

回答(1 个)

秋月
秋月 2022-9-26
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.

类别

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