Question: Switch Names and Surnames Write a function SwitchNames that takes a nx 1 string array, each cell consists of a name and a surname, and

Switch Names and Surnames Write a function SwitchNames that takes a nx 1 string array, each cell consists of a name and a surname, and switch the names and surname, and insert a comma and space between the surname and the name. Restriction: The function must use the internal function split. For example listOfNameSurnames "Barney Google""Snuffy Smith": "Dagwood Bumstead" 1 listOfNameSurnames = 3x1 string array "Barney Google" "Snuffy Smith "Dagwood Bumstead" OutputStringsArray- SwitchNames (listOfNameSurnames) OutputstringsArray = 3x1 string array "Google, Barney" "Smith, Snuffy" "Bumstead, Dagwood Your Function Save C Reset MATLAB Documentation 1 function OutputStringArray- SwitchNames (InputStringArray) % Your code goes here % 4 5 end Code to call your function C Reset 1 OutputstringsArray: SwitchNames (["Barney Google"; "Snuffy Smith", "Dagwood Bumstead"])
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
