mttVerifyAlternativeEquations.m 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. function delta = mttVerifyEquations(primary,secondary)
  2. searching = 1 ;
  3. length_primary = length(primary) ;
  4. length_secondary = length(secondary) ;
  5. i = 1 ;
  6. j = 1 ;
  7. k = 1 ;
  8. fprintf('k=%i: i=%i j=%i L=%i\n',k,i,j,length_secondary) ;
  9. while searching
  10. k = k + 1 ;
  11. if strcmp(primary(i),secondary(j))
  12. secondary(j) = [] ;
  13. length_secondary = length_secondary - 1 ;
  14. fprintf('k=%i: i=%i j=%i L=%i\n',k,i,j,length_secondary) ;
  15. i = i + 1;
  16. j = 1 ;
  17. else
  18. j = j + 1 ;
  19. end
  20. if length_secondary<1
  21. searching = 0 ;
  22. elseif j>length_secondary
  23. i = i + 1 ;
  24. j = 1 ;
  25. end
  26. if i>length_primary
  27. searching = 0 ;
  28. end
  29. end
  30. delta = secondary ;
  31. fprintf('Verification complete after %i iterations\n',k) ;
  32. fprintf('...%i new records found\n',length(delta)) ;