How to use findpeaks for a matrix of size A
24 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
navan
am 27 Mai 2015
Kommentiert: Star Strider
am 28 Mai 2015
I have a matrix of 4*8. I would like to find out the no of peaks in each row,with a condition that peak value-minimum value >1000.How should i do it.I have tried following code, but not working. i have tried [peaks]=findpeaks(A),but not working.
Akzeptierte Antwort
Star Strider
am 27 Mai 2015
The findpeaks function will work, but you have to cycle through the rows:
M = randi(99, 4, 8);
for k1 = 1:size(M,1)
[pks,loc] = findpeaks(M(k1,:));
P{k1} = [pks; loc];
end
The cell array accounts for different numbers of peaks and locations in each row.
6 Kommentare
Weitere Antworten (0)
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!