MATLAB: How to write string delimiter in a string string delimiter Hello The question is very simple, but I can't find the answer on the web. I would like to write a string with ' as content : A = '''; How can I do that ? (I've already tried with \, /, …). Best Answer A = ''''Or:S = 'This is how you write a '' in MATLAB' Related SolutionsMATLAB: Split string with successive delimiters >> A = 'matlab,2016,b,,,'A = 'matlab,2016,b,,,'>> regexp(A,',','split')ans = 1×6 cell array 'matlab' '2016' 'b' '' '' '' MATLAB: String parsing with a delimiter To expand upon that, you can do something like this to loop through the entire string.str = 'counter=10;count=7';parts = regexp( str, '(?<arg>\w+)=(?<val>\d+);', 'names');for k=1:length(parts), arg = parts(k).arg; switch arg, case 'counter', counter = str2double(parts(k).val); case 'count', %do something else. %add additional cases as necessary. endend Related QuestionHow to define string characterString Delimiting and Array StorageHow to write an unformated string to file, i.e., without interpreting % and any other special charactersDelimiter usage
Best Answer