Apply 'findpeaks' in every column
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi guys, i have a problem.
I have a (1200x600) matrix, where each column consists on a trace with at least 3 peaks, and i want to find the 3 maxpeaks in every column.
For the first trace (first column) the following code gives me the 3 max values:
Pilant_Vy_env = xlsread('Pilant_Vy_env.xlsx'); %The matrix is in .xlsx matlab spreadsheet format
first = Pilant_Vy_env(:,1);
[PKS,locs,~,prm] = findpeaks(first); %'first' is the first column of the matrix
[~,i] = sort(prm,'descend');
MAX = first(locs(i(1:3)));
plot(1:numel(first),first,'-',locs(i(1:3)),MAX,'o ')
What should i do if i want to use it for all the others 599 columns?
Thank you for your kind consideration,
Mattia
2 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!