Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Code including multiply embedded for loops with conditions

1 Ansicht (letzte 30 Tage)
Manolis Michailidis
Manolis Michailidis am 9 Nov. 2015
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
Hello, i have a signal (nfo) and having found its peaks (pks) and minima (val) i should do the following : If it starts with peak (R0), then for the next peak (R1) if the next minima (K2) < previous (K1) then delete previous(K1,R1) , else delete next(R1,K2) , see the attached photo for better explanation. I have done some code but i get confused in the part than i compare with the previous (K1,R1) , here is my code
for kk=2:length(pks)-1
if pks(kk)<pks(kk+1)
tpks(kk)=pks(kk+1);
tl1(kk)=l1(kk+1);
end
end
tpks=tpks(tpks~=0);
tl1=tl1(tl1~=0);
If my signal starts with minima well the idea is similar (see photo).
Note pks are the peaks data, l1 the location of the peaks , val the minima and l2 the locations of minima. Any help appreciated thanks in advance.

Antworten (0)

Diese Frage ist geschlossen.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by