Check a sequence inside another sequence in matlab -


i have sequences:

{b < < c < d < e},  {a < b < d < e < c} 

how check b < e in above strings or not?

thanks!

you can use regexp:

inputs = {'{b < < c < d < e}', '{a < b < d < e < c}' }; res = regexp( inputs, 'b.*<.*e' ) 

results with

res =  [2]    [6] 

that res{ii} first location of b in input string ii. if res{ii} empty means b < e not in ii-th string.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -