Prev: nntool
Next: spatial data and neural networks
From: Jane on 13 Feb 2010 10:59 I think I understand. However is it correct to say that the final interpolated points may not cross the actual data. If so would I need to do this piece by piece? The result is 1000 interpolated points over a set of known points excluding the known points?
From: Jan Simon on 14 Feb 2010 07:13 Dear Jane! > I think I understand. However is it correct to say that the final interpolated points may not cross the actual data. If so would I need to do this piece by piece? The result is 1000 interpolated points over a set of known points excluding the known points? I'm not sure what you mean with "not cross the actual data". Jan
From: Jane on 14 Feb 2010 10:55 Hi, I will try to give an example of my thinking. x = [-5.4 -4.3 -6.7 -2 0 1.2 3.6 6.6 4.8]; y = [-5.3 -4.6 -6.8 -2 0 1.5 3.8 6.7 4.9]; t = -5.4:0.25:-4.3; y2 = interp1(x, y, t) y2 returns -5.3000 -5.1409 -4.9818 -4.8227 -4.6636 next I would like to interpolate from -4.3 to -6.7 of x but using the same spacing will result in a different number of values than the first. If i use smallest to largest I get: t = -6.8:0.5:6.7; y2 = interp1(x, y, t) i get Columns 1 through 12 NaN -6.3385 -5.7615 -5.2364 -4.9182 -4.6000 -4.0348 -3.4696 -2.9043 -2.3391 -1.8000 -1.3000 Columns 13 through 24 -0.8000 -0.3000 0.2500 0.8750 1.5000 1.9792 2.4583 2.9375 3.4167 3.8917 4.3500 4.8083 Columns 25 through 28 5.3000 5.8000 6.3000 NaN how can i keep the order of X data. Does that make any sense?
From: dpb on 14 Feb 2010 11:09 Jane wrote: > > Hi, > > I will try to give an example of my thinking. > > x = [-5.4 -4.3 -6.7 -2 0 1.2 3.6 6.6 4.8]; > y = [-5.3 -4.6 -6.8 -2 0 1.5 3.8 6.7 4.9]; > > t = -5.4:0.25:-4.3; > y2 = interp1(x, y, t) > > y2 returns > -5.3000 -5.1409 -4.9818 -4.8227 -4.6636 > > next I would like to interpolate from -4.3 to -6.7 of x but using the > same spacing will result in a different number of values than the first. So, compute the dx between xup and xlo to give the number of intermediates wanted... > If i use smallest to largest I get: > t = -6.8:0.5:6.7; > y2 = interp1(x, y, t) > i get > Columns 1 through 12 > NaN -6.3385 -5.7615 -5.2364 -4.9182 -4.6000 -4.0348 > ...[data elided for brevity]... > > how can i keep the order of X data. Does that make any sense? Not to me it doesn't. You're interpolating using the range of the dependent variable as the independent in this example. Why on earth are you doing that???? --
From: Jane on 14 Feb 2010 11:53
forget it i will try and read a book about it |