- Define the line as a function f
- Given (x,y), delete the point if f(x) < y satisfies
How can I remove unwanted noise data., shown at the right of the red line
1 次查看(过去 30 天)
显示 更早的评论
Is there any function that is able to solve the problem?
0 个评论
回答(1 个)
Hiro Yoshino
2022-5-24
% data
X = rand(100,2);
x = X(:,1);
y=X(:,2);
plot(x,y,'o'); hold on
% function
f = @(x) x.^2;
x2 = sort(x);
y2=sort(f(x));
plot(x2,y2); hold off
% Find the data poits that satisfies f(x) > y
idx = f(x) > y;
plot(x(idx),y(idx),'o',x2,y2,'r-');
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Time Series 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!