MATLAB: How to split a String split string Hi , I have a string 2-1 . I want to split this into Two different strings 2 and 1. Can someone please throw some light on how to use the split string function. Thanks in Advance. Best Answer s2 = regexp(string, '-', 'split') Related SolutionsMATLAB: Regexp problem in ‘.’ Try%%test='abcde.abcde';regexp(test,'\.','split')returnsans = 1×2 cell array {'abcde'} {'abcde'} dot stands for any single character. An escape is needed to a literal dot. MATLAB: Split String into Alphabets you could access each element of the string by looking at input_text(i) where i varies from 1 to size(input_text,2).for example, input_text(1:3) will give you 'hel';For more sophisticated tasks, you may want to look into cell variables for they give a lot more flexibility. Related QuestionHow to split stringHow to split a stringSplit string into string based on character typeThe first letter of the output string will be the first letter of the first word of the sentence.Split string with successive delimiters
Best Answer