Sergey.Bochkanov wrote:
There is an error in your program. You initialize x and y within inner cycle, so instead of x=y=[0,1,2,3,4] you get x=[0,1,2,3,4,0,1,2,3,4,5,...,3,4] and y=[0,0,0,0,0,1,1,1,1,1,...,4,4,4]. spline2dbuildbicubic() uses only 5 leading elements of x/y, so your code is equivalent to using x=[0,1,2,3,4], y=[0,0,0,0,0]. Of course, with non-distinct nodes, you can't get meaningful result.
Very sorry for my misuderstand. I thought that vector x, and y should contains coordinates for every 25 nodes.
Vectors x, y define a grid, so my exaple should be:
spline2d.spline2dbuildbicubic(new double[] { 0, 1, 2, 3, 4 }, new double[] { 0, 1, 2, 3, 4}, f, 5, 5, ref s);
and matrix f should contains 25 z-values for every nodes.
Now it works perfect.
Thank you for help!