- #1
John31
- 5
- 0
Homework Statement
I have an array of numbers in MATLAB which I want to located the minimum y-value but output the corresponding x value. (I can explain better if needed) I cannot use a bulit in function so I have tried to write my own. This is what I got so far.
The Attempt at a Solution
Code:
function [m n] = recursiveMin(A)
size = length(A);
if isempty(A)
m = [];
n = [];
elseif size == 1
m = A(1);
n = 1;
else
A(1) = max;
for
%this is where I am stuck
end
end