Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started