MATLAB: How to reverse a string in matlab how to reverse a string in matlabMATLAB how to reverse a string in matlab Best Answer Search the documentation/help forflipfliplrflipud Related SolutionsMATLAB: How to reverse a string using a FOR loop Update:myString = "abcdefg";myChar = char(myString);% using array indexingmyNewStr = string(myChar(end:-1:1));% using FOR loop:myNewChar = [];for i = 1:length(myChar) myNewChar = [myNewChar,myChar(end-i+1)];endmyNewStr = string(myNewChar);% myNewStr = % "gfedcba" MATLAB: How to reverse the order of words in string There's undoubetly better solutions, but:strtrim(strrep(cell2mat([flipud(split('Hello. I. am. Here.'))']),'.','. ')) Related QuestionMultiple inputs for a functionConditional PlottingReverse matrix position
Best Answer