Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started