- (Minimum and Maximum) We often want to find the minimum and maximum values in a vector as well as the indices at which these values occur. For this problem do not use the built in min or max...


- (Minimum and Maximum) We often want to find the minimum and maximum values<br>in a vector as well as the indices at which these values occur.<br>For this problem do not use the built in min or max function (or any other function<br>which trivializes the problem).<br>min_max Function:<br>Input variables:<br>• a vector representing the list of numbers; you may assume each value is<br>unique<br>Output variables:<br>• a scalar representing the minimum value<br>• a scalar representing the index where minimum value is located in the list<br>• a scalar representing the maximum value<br>• a scalar representing the index where maximum value is located in the<br>list<br>A possible sample case is:<br>» [min_val, min_i, max_val, max_i] = min_max(1:5)<br>min_val = 1<br>min_i<br>max_val =<br>max_i =<br>1<br>5<br>» [min_val, min_i, max_val, max_i] = min_max([2, 3, 7, 1, 4])<br>min_val = 1<br>min_i<br>4<br>max_val =<br>max_i = 3<br>7<br>» [min_val, min_i, max_val, max_i] = LXX_QYY([1, 2, 3, 4, -1, 0])<br>min_val = -1<br>min_i<br>max_val =<br>%3D<br>4<br>max_i =<br>4<br>

Extracted text: - (Minimum and Maximum) We often want to find the minimum and maximum values in a vector as well as the indices at which these values occur. For this problem do not use the built in min or max function (or any other function which trivializes the problem). min_max Function: Input variables: • a vector representing the list of numbers; you may assume each value is unique Output variables: • a scalar representing the minimum value • a scalar representing the index where minimum value is located in the list • a scalar representing the maximum value • a scalar representing the index where maximum value is located in the list A possible sample case is: » [min_val, min_i, max_val, max_i] = min_max(1:5) min_val = 1 min_i max_val = max_i = 1 5 » [min_val, min_i, max_val, max_i] = min_max([2, 3, 7, 1, 4]) min_val = 1 min_i 4 max_val = max_i = 3 7 » [min_val, min_i, max_val, max_i] = LXX_QYY([1, 2, 3, 4, -1, 0]) min_val = -1 min_i max_val = %3D 4 max_i = 4

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here