MATLAB: Find max of matrix without using built in function.

homeworkmatlab functionmax

I want to find the "max(a)" without actually using the built in "max" function.

Best Answer

mx=a(1);
for p=2:numel(a)
if a(p)>mx
mx=a(p);
end
end
mx %the maximum value