Last active
February 2, 2020 07:33
-
-
Save MShirazAhmad/45218a81e15577944bd3bd029b7c4af1 to your computer and use it in GitHub Desktop.
To Find peaks and corresponding index numbers in array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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