B-spline approximation

Computes the B-spline approximation from a set of coordinates. Supports periodicity and n-th order approximation.

您现在正在关注此提交

Computes the B-spline approximation from a set of coordinates (knots).
The number of points per interval (default: 10) and the order of the B-spline (default: 3) can be changed. Periodic boundaries can be used.

It works on any dimension (even larger than 3...).

This code is inspired from that of Stefan Hueeber and Jonas Ballani [1].

Example (see image):
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
rng(1) % Set random seed for reproductility
XY=rand(5,2); % Random set of 5 points in 2D
BS2=BSpline(XY); % Default order=3 (quadratic)
BS3=BSpline(XY,'order',4); % order=4 -> cubic B-spline
BSper=BSpline(XY,'periodic',true);
h=plot(XY(:,1),XY(:,2),'-o',BS2(:,1),BS2(:,2),BS3(:,1),BS3(:,2),'--',BSper(:,1),BSper(:,2),'-.');
legend('Control polygon','Quadratic','Cubic','Quadratic periodic')
set(h, 'LineWidth',2)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

[1] http://m2matlabdb.ma.tum.de/download.jsp?MC_ID=7&SC_ID=7&MP_ID=485

引用格式

Dorian Depriester (2026). B-spline approximation (https://ww2.mathworks.cn/matlabcentral/fileexchange/71456-b-spline-approximation), MATLAB Central File Exchange. 检索时间: .

致谢

参考作品: MTEX2Gmsh

类别

Help CenterMATLAB Answers 中查找有关 Splines 的更多信息

一般信息

MATLAB 版本兼容性

  • 兼容任何版本

平台兼容性

  • Windows
  • macOS
  • Linux
版本 已发布 发行说明 Action
3.0.3

Update image

3.0.2

Fix confusion between order and degree

3.0.1

Re-upload image

3.0.0

New feature: periodic conditions

2.0.1

Update the title, for it now works in any dimension

2.0.0

Works in any dimension

1.3.0

Ensure that the order is always smaller than the numer of knots

1.2.1

Crop image

1.2.0

Add image

1.1.0

Add example

1.0.0