Question: what am I doing wrong here? Matlab and must contain switch and case Floor directory The table below provides the location of an employee's office

what am I doing wrong here? Matlab and must contain switch and case

what am I doing wrong here? Matlab and must contain switch and

case Floor directory The table below provides the location of an employee's

Floor directory The table below provides the location of an employee's office based on the employee's last name. Name Floor number Hooper Lovelace 2 1 McNulty Snyder Write a function called FindFloor that looks up the corresponding floor based on the user specified lastName. If lastName is not recognized, then assign floorNumber with - 1. The comparions with lastName should be case-insensistive, and should be independent if the data type is a string scalar or a character vector. Restrictions: The function FindFloor must use a switch statement. Ex: >> floorNumber = FindFloor( 'SNYDER') floorNumber = Your Function Save Reset MATLAB Documentation 1 function floorNumber = FindFloor(lastName) UW NP 3 switch floorNumber; 4 case 'hooper 5 floorNumber =2; 6 case 'lovelace' 7 floorNumber =1; 8 case 'mcnulty 9 floorNumber=3; 10 case 'snyder' 11 floorNumber =2; 12 otherwise 13 floorNumber =-1; 14 end

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!