Graph smoothing not working properly

2 次查看(过去 30 天)
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
Thank you in advance.
  2 个评论
Matt J
Matt J 2022-3-31
What error? You should copy/paste all error messages.
Lev Mihailov
Lev Mihailov 2022-4-1
@Matt J at the end of the file, the red line is not built correctly

请先登录,再进行评论。

采纳的回答

MJFcoNaN
MJFcoNaN 2022-4-3
"x" is not monotonous, therefore, you should use this kind of form:
yy1 = smooth(y,0.1,'loess');

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by