MATLAB: Regular Expressions using regexp

matchingregexpregular expressions

I have a cell array of strings a = {'-2.4,-3';'2,3';'0,5';'-4,-2.5';'A';'V';'C'}
Now I want to list those strings which have a "comma".

Best Answer

a={'-2.4,-3';'2,3';'0,5';'-4,-2.5';'A';'V';'C'}
out=a(cellfun(@(x) ~isempty(strfind(x,',')),a))