Could anyone tell me the meaning of pks and locs generated b
Could anyone tell me the meaning of pks and locs generated by matlab function-findpeaks?
In the meantime, if i applied findpeaks function to a magnitude of the frequency like [pks,locs]=findpeaks((abs(MUX)/fs),k) where k is the frequency and abs(MUX)/fs is the magnitude than what will be pks and locs reqresent?
Solution
[pks,locs]=findpeaks((abs(MUX)/fs),k)
by using above command in matlab pks gives about finds local maxima or peaks pks in the input data. data must be a row or column vector with real-valued elements and have a minimum length of three. findpeaks compares each element of data to its neighboring values. If an element of data is larger than both of its neighbors, it is a local peak. If there are no local maxima, pks is an empty vector
locs gives position of particular peak values
>> a=[15 2 3 6 9 18 1 2];
>> [pks lcs]=findpeaks(a)
pks =
18
lcs =
6
