Thread Subject: spap2

Subject: spap2

From: Travis

Date: 20 Mar, 2009 02:03:02

Message: 1 of 3

I am trying to spap2 to interpolate some data that is currently on a 220:5:600 scale to a 220:2:600 scale. The dataset is 77x25.

the formula is spap2(knots,k,x,y)

I am using knots=220:5:600
k=2(not really sure what I am supposed to put here)
x=220:5:600
y=77x25 data

As far as I can tell I am following the example given in the "Bivariate Tensor Product Splines demo. I keep getting the error...
  "The number of sites, 77, does not match the number of values, 25."

Anyone?

Subject: spap2

From: Travis

Date: 7 Apr, 2009 05:32:01

Message: 2 of 3

Does anyone have a clue on hwo to use this command? I have bene emssing around with it for a little while now, and all I get it to do is give me my original data back in a structure form.

Subject: spap2

From: Travis

Date: 15 Apr, 2009 15:57:01

Message: 3 of 3

OK, so I am trying it on a different dataset now, and am getting mixed results. I can get it to return data in a smaller grid than the original, but nothing larger. Here are my variables...

depth = 0, 1, 2, 3, 4, 4.5, 5
temp = 29.60 25.30 24.20 23.10 22.30 22.00 NaN
              29.40 23.70 21.90 20.80 20.20 19.85 19.50
              28.50 23.50 21.80 20.90 20.10 20.05 20.00
              28.10 24.70 23.80 23.00 22.20 21.70 21.20
              28.50 24.40 23.40 22.40 21.80 21.60 NaN
yknots = augknt([0:.5:4.5]kk)
kk = 3
pp = spap2(yknots,kk,depth,temp)

I keep getting a message saying:
The given knots and order are incompatible with the given data sites.
No subsequence of the data sites satisfies the Schoenberg-Whitney
   conditions of the given order wrto the given knots.
If you have trouble coming up with a good knot sequence for the data
   sites, try using spap2(l,k,x,y), with l the desired number of
   polynomial pieces in the spline fit.

If I use the spap2(l,k,x,y) suggestion with pp = spap2(1,kk,depth,temp), then
yy = 0:.05:5;
vals = fnval(pp,yy);

I do get an interpolated surface, but the data at the original points has been changed. I need the original data to stay the same (make them knots). I have tried Tech support, but since I have a student edition they cannot help me.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
spline Travis 7 Apr, 2009 01:30:06
cubic Travis 7 Apr, 2009 01:30:01
interpolation Travis 19 Mar, 2009 22:05:22
spap2 Travis 19 Mar, 2009 22:05:22
rssFeed for this Thread

Contact us at files@mathworks.com