[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Execute and Call_function of complex things
- Subject: Re: Execute and Call_function of complex things
- From: "Pavel A. Romashkin" <pavel.romashkin(at)noaa.gov>
- Date: Thu, 01 Feb 2001 17:37:01 -0700
- Newsgroups: comp.lang.idl-pvwave
- Organization: NOAA-CMDL-CIRES
- References: <95co5g$fjq$1@news.doit.wisc.edu> <95cosa$e9k$1@news.doit.wisc.edu>
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:23360
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