Graph smoothing not working properly
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
When trying to smooth the graph at the end, some kind of error occurs in its construction.
%a=(1+rand(1,size(x,2))).*10^-5; % this code makes my values unique
%b=(1+rand(1,size(x,2))).*10^-5;
%x=x+a;
%y=y+b;
yy1 = smooth(x,y,0.1,'loess'); % with a value of 0.1 I like the beginning of the graph
plot(x,y,'b.',x,yy1,'r-') % when using "rloess" same error
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/947959/image.png)
Thank you in advance.
2 Commenti
Risposta accettata
MJFcoNaN
il 3 Apr 2022
"x" is not monotonous, therefore, you should use this kind of form:
yy1 = smooth(y,0.1,'loess');
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!