Question: Consider the following function, which is required to return the total number of all medals for the country with the largest combined number of gold

Consider the following function, which is required to return the total number of all medals for the country with the largest combined number of gold and silver medals. Each row of the input argument table, assumed to be a non-empty three-column matrix, represents one country. The first, second, and third columns of table give the number of gold, silver, and bronze medals, respectively. function total = compute(table) value = sum(table(1, 1:2)); total = sum (table(1,:)); [rows, cols] = size (table); for i = 1:rows if sum (table(1, 1:2) > value value = gum (table (i, :)); total = gum (table (i, :)); end end . Which of the following statements is true? cross out cross out Select one: O a. The function has both syntax and logical errors. b. The function has logical but not syntax errors. c. The function has syntax but not logical errors. d. The function will fail due to a runtime error. e. The function will correctly compute the total. cross out cross out cross out
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
