How do I fit a spline to my scatter plot, without showing the scatter points in my plot?

7 ビュー (過去 30 日間)
Arghadwip Paul
Arghadwip Paul 2017 年 6 月 27 日
回答済み: Mishaal Aleem 2017 年 6 月 27 日
What I am doing now is draw a scatter plot of my data points and then use basic fitting toolbox to fit a spline. But, it also shows the scattered points which I don't want to show. Is there any way to do this? Thank you.

回答 (1 件)

Mishaal Aleem
Mishaal Aleem 2017 年 6 月 27 日
Programmatically, assuming x and y are the vectors of your scatter plot, you can try the following
xx = min(x):0.001:max(x); % change your step size (currently 0.001) based on desired plot smoothness
yy = spline(x,y,xx);
plot(xx,yy)
You can see some examples in the spline documentation: https://www.mathworks.com/help/matlab/ref/spline.html

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by