Matching only parts of two cell arrays
    6 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
A= {'36450A107';'36467A107';'38067A107'}
B={'36467A'};
How can I find that the 2nd cell in A matches the first 6 characters of B?
0 comentarios
Respuesta aceptada
  Azzi Abdelmalek
      
      
 el 14 de Jul. de 2013
        
      Editada: Azzi Abdelmalek
      
      
 el 14 de Jul. de 2013
  
      out=find(cellfun(@(x) strcmp(x(1:6),B),A))
0 comentarios
Más respuestas (2)
  Chandrasekhar
      
 el 14 de Jul. de 2013
        for i = 1:length(A)
TF = findstr(char(B(1)),char(A(i)))
if(TF == 1)
disp(i)
end
end
Ver también
Categorías
				Más información sobre Logical en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



