Clear Filters
Clear Filters

Why does the code shows match values and mismatch values??

1 view (last 30 days)
one_c=0;
tem_h=-100;
tem_L=100;
high_p=0;
low_pr=0;
o_pr=0;
for p = 1:no_ofbits
for m = 1:process_g
pin=m+(p-1)*process_g;
o_p=o_p+quick(pin);
if strong(pin)==1
one_c=one_c+1;
if v(pin)>=tem_h
tem_h=v(pin);
high_p=pin;%pointer is for diagnostic purposes
end
if v(pin)<=tem_L
tem_L=v(pin);
low_p=pin;%printer is for diagnostic purposes
end
end
end
end
am = temp_h + temp_L;
am = (ad/2);
a1 = (am/5);
b1=t(win(1));
verify(1)=a1;
verify(2)=b1;
verify(3)=o_p;
I am trying to run this code. everytime I run the code matrix verify shows (1), (2) columns matched and (3) which is what I want as 0. But when I run the same code everytime during 8th or 11th time it shows a mismatch between (1), (2). I have run this code many times. but still it shows correct result, but during 7times and 8th times it fails. I am trying it extremely hard to understand why is it showing a mismatch and then again match after that.
Can someone please help me in this? I am not able to list out the reason why is it behaving correct in some runs and changes output after 8th or 9th run. Kindly help
  4 Comments
Walter Roberson
Walter Roberson on 11 Jun 2019
Undefined function or variable 'process_g'.
Undefined function or variable 'o_p'.
Undefined function 'quick' for input arguments of type 'double'.
Undefined function or variable 'strong'.
Undefined function or variable 'v'.

Sign in to comment.

Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!