MPD78
06-18-2009, 01:30 PM
Hello all,
I am using the Linear_interp function and following the example in chapter 3 of the book and I am having some trouble (as usual) with the passing of arguments to the fucntion.
My code is show below
#include "interp1d.h"
using namespace std;
Doub pause; /* Just a dummy variable used to keep the
output screen up*/
// made up arrays of data
Doub xx[] = {1,2,3,4,5,6,7,8,9,10}; //
Doub yy[] = {100,200,300,400,500,600,700,800,900,1000};
int main()
{
Int n=10;
VecDoub xx(n), yy(n);
Linear_interp myfunc(xx,yy);
Doub x,y;
x=1.5;
y=myfunc.interp(x);
cout << y << endl;
cin >> pause;
return 0;
}
My answer should be 150.
Any help would be appreciated as always.
Thanks
Matt D.
I am using the Linear_interp function and following the example in chapter 3 of the book and I am having some trouble (as usual) with the passing of arguments to the fucntion.
My code is show below
#include "interp1d.h"
using namespace std;
Doub pause; /* Just a dummy variable used to keep the
output screen up*/
// made up arrays of data
Doub xx[] = {1,2,3,4,5,6,7,8,9,10}; //
Doub yy[] = {100,200,300,400,500,600,700,800,900,1000};
int main()
{
Int n=10;
VecDoub xx(n), yy(n);
Linear_interp myfunc(xx,yy);
Doub x,y;
x=1.5;
y=myfunc.interp(x);
cout << y << endl;
cin >> pause;
return 0;
}
My answer should be 150.
Any help would be appreciated as always.
Thanks
Matt D.