Question: Matlab question: !Use functions erase and strtrim! Find US state names that start with the letter N Write a function RemoveNStates that will remove all
Matlab question: !Use functions erase and strtrim!

Find US state names that start with the letter N Write a function RemoveNStates that will remove all the states that start with the letter N in a given a string with US states The function should remove remove all consecutive white space charaters from the start and the end of the output string. The input will be a character array. You can assume the names of the states are spelled exactly as given in US states. Restrictions: The function may not use loops. The function should use the function erase and strtrim. For example, >> s1 = 'Alabama Montana Nebraska Vermont Nevada; reduced List = RemoveNStates(s1) reducedList Alabama Montana Vermont Your Function Save Reset MATLAB Documentation 1 function s2 = RemoveNStates(s1) % Your solution goes here % 4 5 end Find US state names that start with the letter N Write a function RemoveNStates that will remove all the states that start with the letter N in a given a string with US states The function should remove remove all consecutive white space charaters from the start and the end of the output string. The input will be a character array. You can assume the names of the states are spelled exactly as given in US states. Restrictions: The function may not use loops. The function should use the function erase and strtrim. For example, >> s1 = 'Alabama Montana Nebraska Vermont Nevada; reduced List = RemoveNStates(s1) reducedList Alabama Montana Vermont Your Function Save Reset MATLAB Documentation 1 function s2 = RemoveNStates(s1) % Your solution goes here % 4 5 end
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
