Quantcast
Channel: Math.NET Numerics - Math.NET
Viewing all articles
Browse latest Browse all 224

Spline results vary from MatLab

$
0
0

@rodokal wrote:

When I run the following command in MatLab I get the result 60.206318681318677

 MatLab>> spline([1265.0, 1277, 1290, 1305], [56.0, 53, 57, 64], [1260])

I'm trying to implement this in C# with the following code and get the result 57.799621215812778 instead.

 var x = new List<double>(new[] { 1265.0, 1277, 1290, 1305 });
 var y = new List<double>(new[] { 56.0, 53, 57, 64 });
 var answer = MathNet.Numerics.Interpolation.CubicSpline.InterpolateNatural(x, y).Interpolate(1260);

Is there a way to get interpolation results that match MatLab?

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 224