I am trying the understand the logic of what Querying the Interpolant
does in matlab and write a logic in c#.
The following code is in matlab.
D = griddedInterpolant(A,B,'linear');
where A=[1;2;3;4;5] B=[6;7;8;9;10]
T=[1;2;3;4;5]
Now when execute the below statement,
D(T)
this is the result I am getting.
ans = [6;7;8;9;10]
I did not understand what is the formula that is producing this result. I found a formula which is as below,
y=((Y2-Y1)(X-X1)/(X2-X1))+Y1
Linear Interpolation Calculation
I did not understood how we calculate using this formula with vector matrix i had.
Could someone please help me what is the formula that we use and how to use.