Code covered by the BSD License  

Highlights from
Approximation of 2-D Data by Natural Cubic Spline

3.33333

3.3 | 6 ratings Rate this file 9 Downloads (last 30 days) File Size: 10.26 KB File ID: #7617
image thumbnail

Approximation of 2-D Data by Natural Cubic Spline

by Dr. Murtaza Khan

 

10 May 2005 (Updated 09 Jul 2009)

Approximation (Data Fitting) by Natural Cubic Spline.

| Watch this File

File Information
Description

ncs2dapprox.m
-------------
Function for cubic spline approximation of 2D data.

Syntax of Usage:
[arg1out,arg2out,arg3out,arg4out]=ncs2dapprox(arg1in,arg2in,arg3in,arg4in)

arg1in: Input x-Data e.g. [x1, x2, x3,...,xn]
arg2in: Input y-Data e.g. [y1, y2, y3,...,yn]
arg3in: Maximum allowed Square Distance between Data and parametric values (Optional argument)
arg4in: Indices of Data where Spline MUST interpolate (Optional argument)

arg1out: x-values of output break points
arg2out: y-values of output break points
arg3out: Indices of output break points
arg4out: max squared distance b/w input and output values

Testncs2dapprox.m
-----------------
A Test program that shows how to use ncs2dapprox.m

Details
Suppose we have set of continuous points (xi,yi), 1<=i<=n (e.g. boundary or some signal) and we want to approximate them using Natural Cubic Spline.

A general concept of fitting Algorithm is following:

1. Fit the spline to Data using initial break points.
2. Find the Max. square distance b/w spline approximated data and original data.
3. while(Max. Square Distance > Max Allowed Square Distance)
4. Add point of max. distance to set of break points.
5. Fit the spline using new set of break points.
6. Find the Max. square distance b/w spline approximated data and original data.
7. Go to step 3.
8. end while
------------------------------

MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (6)
31 May 2005 awedat nabeel

we have problem in 2d interpolation and this page did not provide very useful information

01 Jun 2005 kan san

excellent solution to automatic approximation of 2D data.

29 Sep 2005 M Khan

From Author:
Following is link to more advanced version of data approximation by cubic spline where each data point can be in N-D Euclidean space.

http://www.tekcities.com/mak2000/help_splineapprox.html

23 Jan 2006 gok gok

got hard to trace errors. Demo version is limited to 1000 input points.

21 Jun 2006 adham ghallap  
05 Oct 2007 Rita Hsiao

But I need the advanced version which is used
in the N-D space. However, the link is failed. Would you offer it again?
Thanks a lot!!

Please login to add a comment or rating.
Updates
24 Mar 2006

Minor change in description

05 May 2006

more compact coding

09 Jul 2009

BSD License

Tag Activity for this File
Tag Applied By Date/Time
approximation Dr. Murtaza Khan 22 Oct 2008 07:48:17
interpolation Dr. Murtaza Khan 22 Oct 2008 07:48:17
natural cubic spline Dr. Murtaza Khan 22 Oct 2008 07:48:17
data fitting Dr. Murtaza Khan 22 Oct 2008 07:48:17
parametric curve Dr. Murtaza Khan 22 Oct 2008 07:48:17

Contact us at files@mathworks.com