How to local maxima of a matrix, row by row ?

1 view (last 30 days)
Clebod
Clebod on 12 Oct 2015
Commented: Clebod on 12 Oct 2015
Hello everybody!
I want to extract local maxima of my matrix "LSup" (74x101)row by row (1 row = 1 subject)
I used findpeaks but for the moment it doesn't works because this function need a vector ...
my code is this :
for i=[1:74];
seuil=0.02;
[pks,locs] = findpeaks(LSup(i,:),'THRESHOLD',seuil);
end
Thank you for your help

Answers (1)

Walter Roberson
Walter Roberson on 12 Oct 2015
for i=[1:74];
seuil=0.02;
[pks{i},locs{i}] = findpeaks(LSup(i,:),'THRESHOLD',seuil);
end
A cell array is needed because there can be different numbers of peaks per row.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!