Suppose I have the F matrix like this:
F = 0, 0, 106, 10, 14, 20, 20, 23, 27, 26, 28, 28, 28, 23 | | | peak
Well here is what I prefer:
[maxval maxloc] = max(A(:));
Use the findpeaks function (Signal Processing Toolbox).
[peakVal,peakLoc]= findpeaks(x);