How to find pattern in an array?
Afficher commentaires plus anciens
How to find a pattern from a numeric array?
For example, there is a numeric array B and pattern (or mask) A. How to get the pattern location found in B?
>> A = [1 2 3];
>> B = [5,4,3,1,2,3,5,4,1,2,3,4,5];
Expected output: 4, 9
Réponse acceptée
Plus de réponses (1)
claudio
le 14 Mai 2020
2 votes
output = strfind(B,A);
1 commentaire
claudio
le 14 Jan 2021
No exceptions. if you have a particular request you can submit it to evaluate the specific case
str = sprintf('Special string for \t Karel \t K');
pattern = sprintf('\t');
idxTab = strfind(str,pattern)
idxTab =
20 28
Catégories
En savoir plus sur Structures dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!