Question: For this problem, I am looking for you to write the code necessary to check each value in three vectors to evaluate if a simulated
For this problem, I am looking for you to write the code necessary to check each value in three vectors to evaluate if a simulated sequence of colors generated colorpicks match a simulated series of clicks that would be generated by using the ginputfunction xvalsand yvals If the click location matches the section of the play area corresponding to a color generated from colorpicks, you need to increment add one to the correctvariable Do not use ginputin this problem, I am giving you the result of a simulated series of clicks. The order of each vector needs to match for this problem, like it would in your team code submission. You need to use a for loop to go through the first to the last element in each vector. The length of each vector is indicated by the testvariable I provide. I am providing you with extra code and comments that explains what I am providing you to use for this problem. Please note that most of this is simulated data and other code for testing to ensure your code works in any situation. You would not include a lot of this in your team code submission. However, you would want to use or could use the code you are expected to type for this problem in your team code submission, adjusting any variable names, as needed.
xvals are pseudorandomly selected values between and yvals are pseudorandomly selected values between and These represent the x and y coordinates of a click on the play area.
Selections with xvalsgreater than or equal to and less than AND yvalsgreaters than or equal to and less than represent simulated clicks in the GREENsection of the play area.
Selections with xvalsgreater than or equal to and less than AND yvalsgreaters than or equal to and less than represent simulated clicks in the REDsection of the play area.
Selections with xvalsgreater than or equal to and less than AND yvalsgreaters than or equal to and less than represent simulated clicks in the BLUEsection of the play area.
Selections with xvalsgreater than or equal to and less than AND yvalsgreaters than or equal to and less than represent simulated clicks in the YELLOWsection of the play area.
colorpicksvalues of represent GREEN, values of represent RED, values of represent BLUE, and values of represent YELLOW.
Use the above information to help you determine if the color selected for an element in the colorpicksvector matches the corresponding location represented by a simulated click in the same location in the xvalsand yvalsvectors If it does match, increment add one to the correctvariable Keep doing this for each value, from the first to the last, in the vectors. This represents checking each color generated by the game in sequence against the color selected by the player in the Matlab Memory Matching game.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
