Spline interpolation in matlab

  • Follow


Does the function yy = spline(x,Y,xx) in matlab interpolate using cubic B-splines? If yes does it take care of mirror boundary conditions? If not how do I interpolate using B-splines and incorporate mirror boundary conditions? Any help appreciated.
0
Reply ee09b040 (7) 7/12/2012 2:43:07 PM

"Nagaraj" wrote in message <jtmnpr$m91$1@newscl01ah.mathworks.com>...
>
> Does the function yy = spline(x,Y,xx) in matlab interpolate using cubic B-splines?
===========

Since the interpolation is cubic and since cubic B-splines are a basis for the space of piece-wise cubic functions, then yes, you can consider SPLINE to be "using" cubic B-splines.

SPLINE doesn't do mirror boundary conditions as far as I can see, but if your samples are uniformly spaced, this FEX tool let's you do mirror boundary conditions (See Example1.m):

http://www.mathworks.com/matlabcentral/fileexchange/26292-regular-control-point-interpolation-matrix-with-boundary-conditions 
0
Reply mattjacREMOVE (3177) 7/12/2012 2:57:14 PM


"Nagaraj" wrote in message <jtmnpr$m91$1@newscl01ah.mathworks.com>...
> Does the function yy = spline(x,Y,xx) in matlab interpolate using cubic B-splines? 

Yes.

>If yes does it take care of mirror boundary conditions? 

No.

>If not how do I interpolate using B-splines and incorporate mirror boundary conditions?

Simplest is mirror the data:

x=0:5
y=rand(size(x))

xm=[-x(end:-1:1) x(2:end)]
ym=[y(end:-1:1) y(2:end)]
xi=linspace(xm(1),xm(end))
yi=spline(xm,ym,xi)

plot(xm,ym,'or',xi,yi,'b')

% Bruno
0
Reply b.luong5955 (6338) 7/12/2012 8:15:07 PM

2 Replies
28 Views

(page loaded in 0.094 seconds)


Reply: