Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Code including multiply embedded for loops with conditions

조회 수: 1 (최근 30일)
Manolis Michailidis
Manolis Michailidis 2015년 11월 9일
마감: MATLAB Answer Bot 2021년 8월 20일
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.

답변 (0개)

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by