|
From: Brouard N. <br...@in...> - 2008-03-15 23:26:42
|
Le samedi 15 mars 2008 à 01:22 +0100, Juergen Wieferink a écrit :
> > Many thanks for your help, but I just got that:
> > gnuplot> evie(x, y) = real(system("echo 90 %f 0 %f 0.1
> > 1|./eviegompertz", x, y)) gnuplot> print evie(alpha,beta)
> > sh: 0.09400: command not found
> >
> > warning: internal error--stack not empty!
> > (function called with too many parameters?)
> > 0.0
>
> Aaarg, sorry, there is an sprintf missing:
>
> evie(x, y) = real(system(\
> sprintf("echo 90 %f 0 %f 0.1 1|./eviegompertz", x, y)))
>
> You can even make it more readable:
>
> evie_cmd(x, y) = sprintf("echo 90 %f 0 %f 0.1 1|./eviegompertz", x,
> y)
> evie(x, y) = real(system(evie_cmd(x, y)))
>
> > gnuplot> help function system
> > Sorry, no help for 'function style system'
> > gnuplot>
>
> help functions system
>
> The 's' is crucial here.
That's the power of sprintf. Many thanks.
This is in the help:
This can be used to import external functions into gnuplot using
'f(x) = real(system(sprintf("somecommand %f",x)))'
It works with 4.2.
Thanks again for your help, it works fine.
> Juergen
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> gnuplot-beta mailing list
> gnu...@li...
> https://lists.sourceforge.net/lists/listinfo/gnuplot-beta
|