How can I remove the value of a vector that is less than the next value?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
giancarlo maldonado cardenas
am 11 Jul. 2022
Bearbeitet: giancarlo maldonado cardenas
am 12 Jul. 2022
for example:
I have the following vector:
xfirstpeakstore= [664 705 728 803 824 849 893 895 ........ Nnumbers;
In my code I have a for that stores the points in the variable xfirstpeakstore, so when the next point found is less than 3 it is eliminated, as we can see in the vector of the example we have the number 893 and 895, these meet the condition then The number 893 would have to be eliminated and the 895 stored, and the for will continue looking for the next point until the condition is fulfilled again.
0 Kommentare
Akzeptierte Antwort
dpb
am 11 Jul. 2022
MinDiff=3;
xfirstpeakstore= [664 705 728 803 824 849 893 895];
ix=find(diff(x)<MinDiff);
xfirstpeakstore(ix)=[];
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu LTE Toolbox 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!