MATLAB: Finding the peak position of a plot

Computer Vision ToolboximageImage Acquisition Toolboximage processingImage Processing Toolboxpeakpeak valueplot

Hi,can anyone tell me how to find the peak of a plot . I have the code plot(sum(fill>0)); Now how to find the peak value of the plot??

Best Answer

If sum(fill>0) is the thing you want the maximum of, you could use
[C,I] = max(sum(fill>0));
The C give the maximum value (or values, if you have a matrix) and I the position(s).