Question: Hi can you write the scripts for b) and c) in MATLAB? 1. The following is an extract of the help text for the command
1. The following is an extract of the help text for the command find: find Find indices of nonzero elements. I = find (X) returns the linear indices corresponding to the nonzero entries of the array x. X may be a logical expression. [I,J) - find (X) returns the row and column indices instead of linear indices into X. (1,J,V) - find (X) also returns a vector V containing the values that correspond to the row and column indices I and J. Example: A - magic (3) find (A > 5) finds the linear indices of the 4 entries of the matrix A that are greater than 5. (a) Using the find command/function as an example, explain the meaning of input and output arguments and how they are used. (b) Write a function to find the winner of a running race with the following format: [winner, losers) - findwinner (entrants) entrants is a matrix with two columns of data, where the first column contains a number to identify the entrant, and the second column contains their race time in seconds, losers is the same matrix with the winner's identification number and time removed, winner is a vector containing the winner's identification number and time. (c) The results of this year's race are stored in the same format as in part (b) in a variable called Race2017. Write a script that displays the entrants and times in the order that they finished. You can use the function from part (b)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
