Dear Rene:
Maybe I don't fully understand "TSpline" or I misunderstand what you mean.
I tried but still fail. Here is my code:
void interpolation2(void)
{
int x[10]={1,2,3,4,5,6,7,8,9};
int y[10]={1,2,3,4,5,4,3,2,1};
TGraph *mygra=new TGraph(10,x,y);
TSpline3 *s=new TSpline3("s",mygra);
TF1 *formula=new TF1("formula","s->Eval(x)",1,9);
// TF1 *formula=new TF1(“formula”,“mygra->Eval(x)”,1,9); (<-- still fail)
mygra->Draw("AC*");
formula->Draw("same");
}
The error message is :
Error in <TFormula::Compile>: Bad numerical expression : "s.Eval(x)"
Error in <TF1::TF1>: function: formula/s->Eval(x) has 0 parameters instead of 1
=========================================================
I need to calculate a integration whose integrand formed by timing this interpolation
result with another theoretical function(blackbody formula actually). So I need to
transform this discrete data points to a normal and usable function. Or any other
way I can do?
Thank you very much,
Jack.