Re: Cubic Spline in parametric form
- From: "Predictor" <predictr@xxxxxxxxxxxxxxxx>
- Date: 26 May 2006 17:26:01 -0700
The functions 'spline' and 'pchip' are available in the bae MATLAB
product which will provide the coefficients of the spline polynomial,
but using the original abscissae. For example:
X = [1 2 3 4]; % abscissae
Y = [2 5 7 9]; % ordinates
S = spline(X,Y)
S =
form: 'pp'
breaks: [1 2 3 4]
coefs: [3x4 double]
pieces: 3
order: 4
dim: 1
S.coefs
ans =
0.1667 -1.0000 3.8333 2.0000
0.1667 -0.5000 2.3333 5.0000
0.1667 0 1.8333 7.0000
The values in S.coefs are the spline polynomial coefficients, but the
polynomial in the middle segment, for instance, operates on values from
2 to 3.
-Will Dwinnell
http://will.dwinnell.com
Nik Syahrim wrote:
Here is my problem.
I need to connect points with cubic splines. For example, four points
connected with three splines.
The equations of the cubic spline is defined in function of t
(parametric equation)
like this:
x(t) = (a3)t^3 + (a2)t^2 + (a1)t + a0
y(t) = (b3)t^3 + (b2)t^2 + (b1)t + b0
t= [1..0] (t varies from 1 to 0 for each spline.)
What I need are the coefficients of the parametric equations, (a3,
a2, a1, b3, b2 and b1)
.
- References:
- Cubic Spline in parametric form
- From: Nik Syahrim
- Cubic Spline in parametric form
- Prev by Date: error about the sub function
- Next by Date: Re: fix gaps in 2D
- Previous by thread: Cubic Spline in parametric form
- Next by thread: matlab program help !!!
- Index(es):
Relevant Pages
|
Loading