Help with finding highs

Hello! My signal goes smoothly then at some stage it rises sharply and for a long time keeps this tendency
I am trying to use the findpeaks function to find this indicator i.e. when the signal goes up but nothing works for me
Data=[20 21 20 21 21 90 92 93 90 93 90 59 30]

4 Comments

Adam
Adam on 20 Aug 2019
Edited: Adam on 20 Aug 2019
Show us what you tried and what you expect to be the correct answer. Saying 'nothing works' doesn't help anyone who might answer your question.
x= Data(:,1);
y = Data(:,2);
[peaks, locations] = findpeaks(y)
plot(x,y)
hold on
scatter(x(locations),y(locations),20,'filled')
hold off
I did like this, but I can not decipher the values ​​that I got
I don't know what you are doing with x and y. Data is a row vector as you showed it in the question so x and y would just be the first two elements, as scalars.
[peaks, locations] = findpeaks( Data );
would give you the peak values and their respective indices inito the Data matrix.
I'm just trying to get at least something. I try to do an automatic search for a single peak
Data=[20 21 20 21 21 90 92 93 90 93 90 59 30 102 30 21 22 23 21]
those. I need to get data 21 90 92, I can see one manually, but I would like to start this process in a cycle. value 102 is the outlier

Sign in to comment.

Answers (1)

Steven Lord
Steven Lord on 20 Aug 2019

0 votes

Do you want to find a local maximum? If so see the islocalmax function.
Do you want to find a place where your data changes significantly? If so see the ischange function.
Do you want to find, clean, or remove the outliers? If so see the isoutlier, filloutliers, and/or rmoutliers functions.
All the functions I mentioned are in the Preprocessing Data section of the documentation. If none of them do exactly what you want, perhaps you can combine them with other data preprocessing functions to achieve your goal.

3 Comments

[TF,S1] = ischange(Data);
plot(Data,'*')
hold on
stairs(S1)
legend('Data','Segment Mean','Location','NW')
Undefined function or variable 'ischange'.
Error in Untitled (line 11)
[TF,S1] = ischange(Data);
here is such an error, and yes I need to know a sharp change in my values ​​with the condition that the next few will fall / rise but smoothly
ischange was introduced in release R2017b. Are you using an earlier release?
I have 2017a

Sign in to comment.

Products

Tags

Asked:

on 20 Aug 2019

Commented:

on 21 Aug 2019

Community Treasure Hunt

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

Start Hunting!