Answered step by step
Verified Expert Solution
Link Copied!

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)

image text in transcribedimage text in transcribed

(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

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What are some good names for a sports gambling agency?

Answered: 1 week ago