Skip to content

Instantly share code, notes, and snippets.

@MShirazAhmad
Last active February 2, 2020 07:33
Show Gist options
  • Save MShirazAhmad/45218a81e15577944bd3bd029b7c4af1 to your computer and use it in GitHub Desktop.
Save MShirazAhmad/45218a81e15577944bd3bd029b7c4af1 to your computer and use it in GitHub Desktop.
To Find peaks and corresponding index numbers in array
function [pks,locs,index] = PeaksIndices(Y1,X1)
[pks,locs] = findpeaks(Y1,X1);
for i=1:length(pks);
index(i)=find(Y1==pks(i) & X1==locs(i));
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment