Question concerning usage of cscvn and fnplt

1 次查看(过去 30 天)
Hello everybody,
I'm trying to fit a spline to a set of data. I use a loop to vary the interval at which i'm using data, this is denoted by the 1:i:end. My data looks like this:
0 0 -0.2000
9.8500 -0.0100 -1.9500
19.7100 -0.0100 -3.6100
I am using the following command to generate a spline
Spline(i) = struct(cscvn([Coord(1,1:i:end); Coord(2,1:i:end);Coord(3,1:i:end)]));
In which the first columns contains x values, the second y, and the third z. If I then try to recreate the data which I tried to fit I use
Points(i).a = fnplt(Spline(i));
I used these two commands right after each other, so without any manipulation. However, I found that the data, as stored in Points(i).a contains some multiples, so repeating pairs of x,y,z data. I've found out that every two points, it shows a repeating entry, an example is:
0 0 -0.2000
4.9039 -0.0061 -1.0789
9.8098 -0.0100 -1.9430
9.8500 -0.0100 -1.9500
9.8500 -0.0100 -1.9500
14.7193 -0.0105 -2.7813
19.6322 -0.0100 -3.5972
19.7100 -0.0100 -3.6100
19.7100 -0.0100 -3.6100
I notice that all the values that are given in input data are multiplied, and the 'interpolated' values only come up once. Is this a result of the piecewise nature of the spline fitting, or is there some cause in the way I'm using the cscvn?
Thanks in advance for your time!
Roy

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Spline Postprocessing 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by