Question: General Procedure For Array Interpolation

So, I am trying to write a method for array interpolation. I have a Matrix that is X by 3, where each column holds specific data (column 1 holds independent data 1, column 2 holds independent data 2, column 3 holds dependent data).

This data comes from a function with 2 independent variables, and I am creating a graph of this function, basically, with both independent variables going from 0 to 1 (approximately 300 values per variable, giving me a matrix with 90k values already). My goal is to use interpolation to get a lot of values in between the points I already calculated.

That being said, I don't know how to use the ArrayInterpolation command to achieve this. I will post my code below if anyone can help me out!

Code:

Interpolate := proc(M::Matrix)
  local i; local j;
  local M1 := Matrix(RowDimension(M),1);
  local M2 := Matrix(RowDimension(M),1);
  local M3 := Matrix(RowDimension(M),1);
  for i from 1 to RowDimension(M) do
    M1(i) := M(i,1);
    M2(i) := M(i,2);
    M3(i) := M(i,3);
  end do;
  print(M1,M2,M3);
  local M4 := Matrix(1000,1);
  local M5 := Matrix(1000,1);
  for j from 1 to 1000 do
    M4(j,1) := 0.001*j;
    M5(j,1) := 0.001*j;
  end do;
  ArrayInterpolation([M1,M2],M3,[M4,M5]);
end proc;

Please Wait...