If I have A = '1' and B = {'2', '3', '4'} And naturally my strfind(B, A) returns ans =
[] [] []
I try to use this in an if statement with
if ~isempty(strfind(B, A)) condition 1else condition 2end
and hope that this will execute condition 2, however it turns out isempty only returns logical 1 when used with strfind… How can I modify my code? And any suggestions on which command works faster between using strfind() and find()? Thank you as always!
Best Answer