Question: interpolation in a procedure

Hi I have been trying to get the inperpolation of some values within a procedure without much success. Maybe someone in mapleprimes might know this already.

 

Basically what I am trying to do is to generate a matrix of values. The values of the columns 1 to 3 are just some values, but then I want column 4 to be the result of the interpolation of some values.

 

I got different errors such as: 

Error, (in CurveFitting:-ArrayInterpolation) data must consist of real, floating point values

 

Anyway the procedure is shown below:

 

InterProc := proc ()

local i; global A, global variable1, global variable2;

A := Matrix(1 .. 4);

variable1 := [0, 100];

variable2 := [12, 20];

with(CurveFitting);

for i from 1 to 10 do

 A(i, 1) := 3+i;

 A(i, 2) := 2*i+A(i, 1);

 A(i, 3) := A(i, 2)-1;

 A(i, 4) := ArrayInterpolation(variable1, variable2, A(i, 1));

end do;

end proc;

 

InterProc();

Please Wait...