Matching only parts of two cell arrays
显示 更早的评论
A= {'36450A107';'36467A107';'38067A107'}
B={'36467A'};
How can I find that the 2nd cell in A matches the first 6 characters of B?
采纳的回答
更多回答(2 个)
Andrei Bobrov
2013-7-14
find(~cellfun('isempty',regexp(A,B)));
Chandrasekhar
2013-7-14
for i = 1:length(A)
TF = findstr(char(B(1)),char(A(i)))
if(TF == 1)
disp(i)
end
end
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB Coder 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!