Indexing at the end of flat peaks

2 次查看(过去 30 天)
LukeJes
LukeJes 2020-9-2
评论: Luke Cohen 2021-3-25
I have been using findpeaks to index my data, however, it is indexing the value at the start of each of the flat peaks. Instead, I want it to index the value at the end of the flat peaks so that I can cut up the data like I have done in my current code below:
[pksr, idcsr] = findpeaks(r_grf, 'MinPeakHeight',-100, 'MinPeakDist',100);
for k1 = 1:numel(idcsr)-1
grfcutr{k1} = r_grf(idcsr(k1)-10:idcsr(k1+1)-10);
end
I have looked at the documentation on flat peaks but it isn't helping in my case.
Image of my uncut data:
Thanks
  2 个评论
Image Analyst
Image Analyst 2020-9-2
Is the value at the flat section always exactly 0, or (if not) do you want to consider values within a specified distance of 0 to be part of the "flat" section? Do you have the Image Processing Toolbox - if so, this has functions which would make it almost trivial. Please attach your data - make it easy for us to help you, not hard (by making us create data somehow).
save('answers.mat', 'r_grf');
Then attach 'answers.mat'.
Luke Cohen
Luke Cohen 2021-3-25
Hi Image Analyst,
I am trying to do something similar to this... can you mention the function in the Image Processing Toolbox that would be useful?

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by