Guest User

Matlab-Pattern

a guest
Aug 13th, 2011
222
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function [ itAppears] = PatternAppears( x,pattern )
  2. % This function helps to take a pattern that is being tested, and the
  3. % current sequence and will return true or false output, indicating wether
  4. % that pattern really appears.
  5. % Input = pattern ( The pattern being tested)
  6. %       = x (The current sequence in the algorithm)
  7. % Output = itAppears ( True or false statment indicating wether the pattern
  8. % appears.
  9. %
  10. % Author: Muntdhar Al-Yassiri
  11.  
  12.  
  13.  
  14. a = strfind(x,pattern);
  15.  
  16. if a > 0
  17.     itAppears = 1;
  18.     disp(itAppears)
  19.    
  20. else
  21.     itAppears = 0;
  22.     disp(itAppears)
  23. end
  24.  
  25.  
  26.  
  27.    
  28.  
  29. return
RAW Paste Data