MATLAB: How to split a string splitstring Hi, I have this string '0231563972' and i want to split it, put a space between the number: '0 2 3 1 5 6 3 9 7 2'. Can you give me suggestions? Best Answer S = '0231563972';newS = regexprep(S, '(.)(?=.)', '$1 ');ornewS = strjoin(num2cell(S),' '); Related SolutionsMATLAB: How to split a String s2 = regexp(string, '-', 'split') MATLAB: How to compact a string s = 'aaaaaaabccccbbbdcccccaaaa'new_s = regexprep(s, '(.)(\1)+', '$1'); Related QuestionHow to convert a 2-D char to stringSplit string into string based on character typeLast letter of a wordSplit a hexadecimal vectorReplacing Occurrences of String
Best Answer