Remove outlier and fit curve
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi all, I am quite new in the field of programming. I have a set of data with outliers, can someone please suggest a way of removing outliers and make the curve follow a normal trend of values instead of plotting NaN. Please see attached shot.
3 commentaires
Réponses (1)
KSSV
le 9 Juin 2016
From the graph, I understand that, you want to remove the data which is greater then 23 (approximately). So, from the data get the position of values which are greater then 23 (your desired values) and make them NaN.
% Pseudo code
x = 1:100 ;
y = rand(size(x)) ;
idx = y>0.7 ; % Get positions in y which are greater then 0.7 (~23 in your case)
y(idx) = NaN ;
plot(x,y) ;
1 commentaire
Voir également
Catégories
En savoir plus sur Two y-axis dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!