S = interpc(Q); interpolates the input curve Q, which may be 2D or 3D, to output the curve S.
interpc() expects that Q is an [(Nq)x2] or [(Nq)x3] array, where Nq = length(Q); That is, the columns of Q must represent the spatial data. This will be generalized in future versions.
S will have higher point density around the regions of Q that have high curvature.
The number of points in S can be specified with a second input argument Ns, which is an positive integer.
That is, S = interpc(Q,Ns) will produce an S such that length(S) = Ns. Ns = 100 by default.
ANY method for interpolation available to MATLAB's inbuilt 'interp1()' can be used. This is specified with third input argument. Default interpolation scheme is 'makima'.
That is, S = interpc(Q,Ns,'pchip') will generate the points of S by pchip interpolation of Q along each component of Q. Future versions will allow different interpolation schemes for x, y, & z components of Q.
interpc() isn't anything revolutionary, but it's designed to be simple and straightforward to use. Perfect for MATLAB beginners.
This function was inspired by my regular use of curvspace(), written by Yo Fukushima. You can get curvspace here.
引用格式
John Kearns (2024). Interpolate Curve - Simple 2D or 3D Curve Interpolation (https://www.mathworks.com/matlabcentral/fileexchange/132563-interpolate-curve-simple-2d-or-3d-curve-interpolation), MATLAB Central File Exchange. 检索时间: .
MATLAB 版本兼容性
创建方式
R2023a
兼容任何版本
平台兼容性
Windows macOS Linux标签
致谢
参考作品: curvspace
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!版本 | 已发布 | 发行说明 | |
---|---|---|---|
1.0.0 |