How to remove some data from the plot?
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Lukasz Zaczek
am 7 Feb. 2021
Beantwortet: David Hill
am 7 Feb. 2021

Hi, I would like to remove this values from my plot.
I think that to achieve this, 2 conditions are needed:
- Each value cannot be greater than the previous one.
- The next value cannot differ from the previous one by more than | 40 |.
- After removing the value, the next one should be compared with the last one, that meets the above conditions.
I tried the loop in which the unwanted values were replaced by NaN, but then the last condition wasn't met, and morover there is no continuity of the graph in this case.
0 Kommentare
Akzeptierte Antwort
David Hill
am 7 Feb. 2021
a=yourArray;
k=2;
while k<=length(a)
if a(k)<=a(k-1)&&a(k)+40>a(k-1)
k=k+1;
else
a(k)=[];
end
end
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Annotations 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!