Info

此问题已关闭。 请重新打开它进行编辑或回答。

Code including multiply embedded for loops with conditions

1 次查看(过去 30 天)
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