Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2. (35 Points) Theater seat search Create a Theater seat search program in MATLAB. The people assigned to each seat is represented by a random
2. (35 Points) Theater seat search Create a Theater seat search program in MATLAB. The people assigned to each seat is represented by a random integer number between 1 and 100. The theater is a rectangular space with 5 rows and 10 columns. Your program will determine in which row and columna person is located. For this, define a function in MATLAB that receives the value person_id. Inside your function you will define 2 variables: row_i and col with the value of 0. Define your theater as a random matrix using the MATLAB function randil) with the appropriate parameters. Using 2 loops move through the rows and columns of your matrix comparing if the person_id matches with the id of the person in that seat. If it matches you will update row_i and col variables with the corresponding position. If the person_id is not found in the theater the function should return row_i = 0 and colj = 0 The same person_id in multiple seats is allowed in this program, so report the last appearance of the values, like in your searchNumber() function example. function crow_i, col_j1 - theaterSeat (person_id) 2. (35 Points) Theater seat search Create a Theater seat search program in MATLAB. The people assigned to each seat is represented by a random integer number between 1 and 100. The theater is a rectangular space with 5 rows and 10 columns. Your program will determine in which row and columna person is located. For this, define a function in MATLAB that receives the value person_id. Inside your function you will define 2 variables: row_i and col with the value of 0. Define your theater as a random matrix using the MATLAB function randil) with the appropriate parameters. Using 2 loops move through the rows and columns of your matrix comparing if the person_id matches with the id of the person in that seat. If it matches you will update row_i and col variables with the corresponding position. If the person_id is not found in the theater the function should return row_i = 0 and colj = 0 The same person_id in multiple seats is allowed in this program, so report the last appearance of the values, like in your searchNumber() function example. function crow_i, col_j1 - theaterSeat (person_id)
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