Question: Matlab Question: !must use internal function Split! Switch Names and Surnames Write a function SwitchNames that takes a n x 1 string array, each cell
Matlab Question: !must use internal function Split!
Switch Names and Surnames Write a function SwitchNames that takes a n x 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 ["Barney Google","Snuffy Smith","Dagwood Bumstead"] listOfNameSurnames 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 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
