Question: Matlab Function Name: gameMap Inputs: 1. (char) an MxN character array representing a game map 2. (char) a single character that represents a player character

 Matlab Function Name: gameMap Inputs: 1. (char) an MxN character array

Matlab Function Name: gameMap Inputs: 1. (char) an MxN character array representing a game map 2. (char) a single character that represents a player character 3. (double) A 1xP vector of rows to be destroyed Outputs: 1. (char) an (M-P)xN character array representing the updated map 2. (double) The number of players present on the updated game map Background: You and your friends are playing the newest Super Smash Bros. game, MATLAB edition! Unfortunately, the new game features a mode where certain parts of the map are destroyed by laser beams shooting across the stage. You need to use your amazing MATLAB skills to find out how many brawlers are left after the deletions sweep the map Function Description: You are given a character array representing the map. First, account for the laser beams by deleting the row (or rows) given by the third input Second, find how many 'players remain on the map. Each player is represented by the character given as the second input to the function. Finally, output the updated array, and the number of players on the map Example greenillzone = ' 'e [newMap, players] gameMap(greenHillzne, e, [1 2 4 8]) newMap 80 players3 Hints: How would you find the number of times a certain character appears in a character vector

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!