Question: (5 pts) For the following function (file name is mymin.m): function (y, ind]=mymin(x) y=x(1); for i=2: length(x) if x(i) > [mn_a, ind_a]=mymin([1 5 8 991)

 (5 pts) For the following function (file name is mymin.m): function(y, ind]=mymin(x) y=x(1); for i=2: length(x) if x(i)> [mn_a, ind_a]=mymin([1 5 8

(5 pts) For the following function (file name is mymin.m): function (y, ind]=mymin(x) y=x(1); for i=2: length(x) if x(i)> [mn_a, ind_a]=mymin([1 5 8 991) Output argument "ind" (and maybe others) not assigned during call to "mymin". [mn_a, ind_a]=mymin([1 5 8 -1]) mn_a = -1 ind_a = 4 Explain why there is an error on the first call and why the code runs without error on the second call. Fix the code the code so that it works properly for both function calls

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!