在MATLAB中平滑2D图 [英] smoothing 2D plot in MATLAB
本文介绍了在MATLAB中平滑2D图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在MATLAB中有一些简单的图,
I have some simple plot like this in MATLAB:
x = [0:5:25];
y = [1 4 7 9 8 3];
plot(x,y)
我的问题是如何使它平滑?在文档中找不到我想要做的任何事情.
My question is how can I smooth it? Haven't found any way of doing what I want in documentation.
推荐答案
也许您可以按如下方式使用spline
Maybe you could make use of spline
as follows
x1 = 0:.1:25;
y1 = spline(x,y,x1);
plot(x,y,x1,y1);
这篇关于在MATLAB中平滑2D图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文