counter

조회 수: 5 (최근 30일)
mahaveer hanuman
mahaveer hanuman 2011년 6월 24일
I=[1 0;1 1;1 0;0 0;0 1;1 1;........90bits]S=[0 1]now i need to calculate bit error =(counter/I);
i need to compare S with I using counter
  댓글 수: 1
Rick Rosson
Rick Rosson 2011년 6월 24일
I do not understand what you are asking. What is "counter"? What does "S" represent? I assume that "I" is a 90 x 2 matrix (or is it 45 x 2) where each row is the outcome of two binary experiments, and there are 45 or 90 total trials. Is that correct?

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

답변 (1개)

Paulo Silva
Paulo Silva 2011년 6월 24일
Why repeating the question, you could and should edit your previous one.
s=[0 1];
I=[0 0;1 1;1 0;0 1;1 0;0 0; 1 0; 1 1; 0 0]
counter=0;
for n=1:size(I,1)
if I(n,:)==s
counter=counter+1;
else
%nothing to be done, just included the else for fun :)
end
end
counter
  댓글 수: 3
mahaveer hanuman
mahaveer hanuman 2011년 6월 24일
I=[0 1;1 1;0 0;0 1;1 0; 0 1;...........90bits]it may contain 50 [0 1];S=[0 1]
counter should count number of [0 1]bits please help me
Paulo Silva
Paulo Silva 2011년 6월 24일
bit error by your example that might not be correct is given by
Berror=(counter/I)
maybe you want this BError=counter/size(I,1) but this gives the opposite, maybe you want BError=1-counter/size(I,1) thus when all rows from I are equal to s (no error) you get BError=0
for the plot, BError is a constant plot(1:size(I,1),BError)
Sorry if all my assumptions aren't correct but you provide no details and I'm no expert in signal processing

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

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by