Find a position of last changing value in array
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Nik Rocky
am 7 Jun. 2020
Kommentiert: Nik Rocky
am 7 Jun. 2020
Hello,
i'm looking for function that detect a position of detection of last changing value (value stay constant or have just little changes).
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/311663/image.png)
In this case tube_dimension = 37;
I'm realize this in for-loop, but maybe thereare better way?
Sensivity_old = Sensivity;
TP ...
FN ....
Sensivity = (TP ./ (TP + FN));
if (Sensivity > Sensivity_old + 1.0e-03)
Sencivity_end = tube_cnt;
else
end
disp(Sencivity_end)
Thank you!
0 Kommentare
Akzeptierte Antwort
Umair Hassan
am 7 Jun. 2020
Bearbeitet: Umair Hassan
am 7 Jun. 2020
Hi Nikita,
You can use MATLAB's built in function differentrial (diff) to find out the minimum variability points of your data. The first index of the those points would be where your data would have the plateau. If you can attach some data, I would give you a code as well, otherwise psuedo code is:
plateau_points=diff(sensitivity);
plateau_points=find(plateau_points ==0) % finding where the points have 0 change
plateau_tube_dimension=tube_dimension(plateau_points(1));
Hope this helps,
Thanks!
1 Kommentar
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Circuits and Systems finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!