Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The code seems to output the right answer EXCEPT that there is a space in front of the sentence. Please help me fix this !!!
The code seems to output the right answer EXCEPT that there is a space in front of the sentence. Please help me fix this !!!
23.44.1: It dseon't mettar waht oedrr the Irettes in a wrod are. (Strings) Part 3 This tool is provided by a third party. Your activity is (final) of larger project Alfa LAB always recorded, but you may need to refresh the page to fill in the banner ACTIVITY 15 Restriction: The function ScrambleLetters must use the custom functions FindConsecutiveOnes and ReverseLetters written in written in the previous assignments "How many consecutive ones?" and "Confuse the reader?", respectively. Your function can simply call the function FindConsecutiveOnes and ReverseLetters For example >> inputString='Ones and 1 is sometimes two '; >>[outputSt ring] = ScrambleLetters (inputString) outputst ring = 'Oens and 1 is semitemos two" Your Function BSe CReset MATLAB Documentation 1 function [outputstring] = ScrambleLetters( inputString) 2 outputString-'; 3 temp = 4 space = 5 returnedst ring-... 7 for i = 1: length(inputString) 8 if inputstring(i) '' 9 temp (end+1) = inputString (1); 10 else 11 returnedString = ReverseLet ters(temp); 12 outputstring = [outputSt ring returnedSt ring]; 13 temp =' '; 14 end 15 end 16 returnedString = Reverseetters(temp); 17 outputSt ring = [outputString returnedSt ring]; 18 endStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started