how to find Intersection of strings
Mostrar comentarios más antiguos
I have two strings
c1=B0C0D0E9
c2=B0C0E9
Answer I need is B0C0E9. How to find this??
Respuestas (1)
Andrei Bobrov
el 6 de Jun. de 2014
Editada: Andrei Bobrov
el 6 de Jun. de 2014
c2 = regexprep(c1,'D0','');
edit
a1 = reshape(c1,2,[])';
a2 = reshape(c2,2,[])';
l = ismember(a1,a2,'rows');
out = reshape(a1(l,:)',1,[]);
2 comentarios
Hari
el 6 de Jun. de 2014
Andrei Bobrov
el 6 de Jun. de 2014
see code after word edit in my answer
Categorías
Más información sobre Vehicle Dynamics Blockset en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!