Question: please help!!!!!!!! LU QUI Write a function with the header line [M, mi, mj] = mymin(x) where the input X is a matrix of any
LU QUI Write a function with the header line [M, mi, mj] = mymin(x) where the input X is a matrix of any size. Your function should output M, the minimum value in that matrix, mi, the row index of the minimum value, and mj, the column index of the minimum value. Your function must find the minimum value in the matrix, X, and output that value in M along with the corresponding row (mi) and column (mj). The only built in MATLAB functions you can use are size(), length(), if, for, while, and end. You cannot use min(), max(), sort ), find ) or any other MATLAB function. If you have a question about this, please ask If there is a duplicate minimum number-your function should display the row and column of the first time that number appears (see second example below) Test your function in the command window >>[M, mi, mi - mymin([1, 4, 5; 18, 2, 3; 0, 4, 5]) M = 0 mi - 3 my - 1 >> [M, mi, mj] = mymin((1. 4. 5; 18, 2, 3; 10, 4, 5; 10, 1, 101) M1 mi - 1 my - 1 unat natuur rode to work in the time even write as much of the code as you can to
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
