MATLAB: Exclude Digits from String using Regexp in MATLAB regexpstring Need to exclude Numbers from String and returns cell arrays of strings in MATLAB e.g str = 'abc76.5_pol0.00_Ev0.3' output {'abc','pol','Ev'} Best Answer regexp(str,'[^\d_\.]*','match')orregexp(str,'[a-zA-Z]*','match') Related SolutionsMATLAB: Excluded Digits from vector I expect there is a much cleaner method, but here is one that works:vector = [1 2 5 13 55 23 15];exDigit = 5;v = vector;hasDigit = false(1,numel(v));while max(v>=1) hasDigit = hasDigit | mod(v,10)==exDigit; v = floor(v/10);endnew_vector = vector(not(hasDigit)) MATLAB: How to find character bigrams from a string str = 'night'; list = cellstr([str(1:end-1); str(2:end)].') Related QuestionExtracting consecutive digits using regexpRegexp qwestionRegexp Find Digit between two hyphensSelecting random part of stringRegexp help
Best Answer