File Exchange

image thumbnail


version 2.0.0 (189 KB) by Santiago Benito
Interpolation, perimeter and area of 2D closed curves defined solely by points.


Updated 06 Feb 2019

View Version History

View License

The interpclosed function creates piecewise polynomial fits of 2D closed curves given by a set of points. The function can be used to:

(i) return the fit itself;
(ii) interpolate values within the curve using an arc-length parametrization;
(iii) compute the area, perimeter and centroid of the curve.

The arc-length parametrization is very useful in this kind of application because these piece-wise polynomial fits usually have different sampling spacing with equally spaced parameter queries.

Several examples can be found in the examples tab.

This function was inspired largely by the functions cscvn, interparc and arclength.

Programmed by Santiago M. Benito at the Chair of Materials Technology of the Ruhr-Universität Bochum, Germany.

Cite As

Santiago Benito (2021). interpclosed (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (6)

Luke Clark


Santiago Benito

Hi Giuseppe, if the argument 'print' is set to true, it will plot the curve and the given points with the axis option 'axis equal'. If you want more flexibility with the plot, I recommend you plot the results yourself as is shown in the example 'Interpolation of a coarsely sampled circle' under the 'Examples' tab. There you will find that the line 'plot(x,y,'o',xyq(1,:),xyq(2,:),':.');' plots the original points as circles and the interpolation with a dotted line. Then you can change the options to your axes freely with ylim(), xlim(), etc. If you need more help, feel free to ask again and please provide an example I can reproduce! Thanks for using the function!


Hi, I have a "little" problem when I use this function: when I plot my 2D closed curve, the limits on y-axis are automatic and the command axis () doesn't work on y-axis. I've discovered that y-axis limits are set as "auto". How can I solve this problem?


You have saved my life!
Infinitely thank you!

Grace FIrsta Lukman

Hamidreza Nourzadeh

MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!