Effacer les filtres
Effacer les filtres

strfind using two strings

2 vues (au cours des 30 derniers jours)
Mate 2u
Mate 2u le 7 Juin 2012
Hi there I have been using strfind to find strings within a string.
Now lets imagine a horizontal axis of time. I want to do strfind of two strings in one go. So lets say we have two strings consisting of 1's and -1's and 0's......then i want to do strfind of 101 of both strings and find the same location.....I hope somebody understands this.

Réponses (1)

Honglei Chen
Honglei Chen le 7 Juin 2012
What's wrong if you just do them separately and then see if there is an intersection?
x1 = num2str(rand(1,10)>0.5)
xloc1 = strfind(x1,num2str([1 0 1]))
x2 = num2str(rand(1,10)>0.5)
xloc2 = strfind(x2,num2str([1 0 1]))
intersect(xloc1,xloc2)

Catégories

En savoir plus sur Characters and Strings dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by