Matching only parts of two cell arrays
Ältere Kommentare anzeigen
A= {'36450A107';'36467A107';'38067A107'}
B={'36467A'};
How can I find that the 2nd cell in A matches the first 6 characters of B?
Akzeptierte Antwort
Weitere Antworten (2)
Andrei Bobrov
am 14 Jul. 2013
find(~cellfun('isempty',regexp(A,B)));
Chandrasekhar
am 14 Jul. 2013
for i = 1:length(A)
TF = findstr(char(B(1)),char(A(i)))
if(TF == 1)
disp(i)
end
end
1 Kommentar
joseph Frank
am 14 Jul. 2013
Kategorien
Mehr zu Logical finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!