[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Execute and Call_function of complex things



Dirk Fabian wrote:
> 
> model='exp((-1.)*(0.0 + Gauss1(x,p(0:2)) + Gauss1(x,p(3:5))))'
> result=call_function(model,p)

For this to work, a compiled wrapper would be needed:

function model, p
return, exp((-1.)*(0.0 + Gauss1(x,p(0:2)) + Gauss1(x,p(3:5))))
end

result=call_function('model', p)
; Or simply
result = model(p)

> expstring='model=exp((-1.)*(0.0 + Gauss1(x,p(0:2)) + Gauss1(x,p(3:5))))'
> result=call_function(expstring, p)

For this to work, I think Execute is needed:

expstring='result=exp((-1.)*(0.0 + Gauss1(x,p(0:2)) + Gauss1(x,p(3:5))))'
junk = execute(expstring)

Cheers,
Pavel