(Matrix-Vector Multiplication) The product of a matrix A and a (column) vector i is defined provided the number of columns of A is equal to the number of rows of 7. Suppose this is the case, and let A...


make mathlab code


(Matrix-Vector Multiplication) The product of a matrix A and a (column) vector i<br>is defined provided the number of columns of A is equal to the number of rows of 7.<br>Suppose this is the case, and let A be m × n and ë be n × 1. Then, the product Aï is<br>defined element-wise by<br>(AF); = Aj,k® k-<br>For this problem, do not use the built-in ability to multiply matrices and vectors.<br>mat_vec Function:<br>Input variables:<br>• a matrix representing A<br>• a vector representing<br>Output variables:<br>• a vector representing At; if the sizes do not match, return an empty<br>vector (produced by [] in MATLAB)<br>A possible sample case is:<br>» b = mat_vec([1 2 ; 2 1], [2 ; -2])<br>b =<br>-2<br>2<br>b = mat_vec([1 2 ; 3 4], [5])<br>[] (0x0)<br>

Extracted text: (Matrix-Vector Multiplication) The product of a matrix A and a (column) vector i is defined provided the number of columns of A is equal to the number of rows of 7. Suppose this is the case, and let A be m × n and ë be n × 1. Then, the product Aï is defined element-wise by (AF); = Aj,k® k- For this problem, do not use the built-in ability to multiply matrices and vectors. mat_vec Function: Input variables: • a matrix representing A • a vector representing Output variables: • a vector representing At; if the sizes do not match, return an empty vector (produced by [] in MATLAB) A possible sample case is: » b = mat_vec([1 2 ; 2 1], [2 ; -2]) b = -2 2 b = mat_vec([1 2 ; 3 4], [5]) [] (0x0)
- (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