matlab怎么做出两维中的样条线?

时间:2026-02-13 09:53:49

1、随机抽取8个点,进行绘图。

n = 8;

x = rand(n,1);

y = rand(n,1);

plot(x,y,'.')

axis([0 1 0 1])

2、按“Enter”键。

如图1所示。

matlab怎么做出两维中的样条线?

3、用两条泪盲爹样条曲线插值点,用较细的间距计算炼著。用红线标出插值曲线。

t = 1:n;

ts = 1:1/10:n;

xs = spline(t,x,ts);

ys = spline(t,y,ts);

hold on

plot(xs,ys,'r'瞧胆);

hold off

4、按“Enter”键。

如图2所示。

matlab怎么做出两维中的样条线?

© 2026 途途旅游
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com