|
From: Brouard N. <br...@in...> - 2008-03-14 11:52:45
|
I am not so familiar with the recent macros but I am able to something like: gnuplot> alpha="3.51e-5" gnuplot> beta="0.09400" gnuplot> evie(alpha,beta)= `echo 90.0000 @alpha 0.00000 @beta 0.10000 1|./eviegompertz` gnuplot>print evie(alpha,beta) 4.230246 where eviegompertz is a private C program which can't be simulated in gnuplot and just output a value. Now I want to just "splot evie(x,y)" where x and y are variables and not only fixed values. Is it possible to do it? I haven't seen such similar examples. It may be trivial, sorry. Nicolas -- Brouard Nicolas <br...@in...> |
|
From: Juergen W. <wie...@fr...> - 2008-03-14 16:42:29
|
Hi,
> gnuplot> alpha="3.51e-5"
> gnuplot> beta="0.09400"
> gnuplot> evie(alpha,beta)= `echo 90.0000 @alpha 0.00000 @beta 0.10000
> 1|./eviegompertz` gnuplot>print evie(alpha,beta)
> 4.230246
>
> where eviegompertz is a private C program which can't be simulated in
> gnuplot and just output a value.
>
> Now I want to just "splot evie(x,y)" where x and y are variables and not
> only fixed values. Is it possible to do it? I haven't seen such similar
> examples. It may be trivial, sorry.
Just use the system function:
alpha = 3.51e-5
beta = 0.09400
evie(x, y) \
= real(system("echo 90 %f 0 %f 0.1 1|./eviegompertz", x, y))
print evie(alpha, beta)
See "help functions system" for details.
Juergen
|
|
From: Brouard N. <br...@in...> - 2008-03-14 19:01:47
|
Le vendredi 14 mars 2008 à 17:42 +0100, Juergen Wieferink a écrit :
> Hi,
>
> > gnuplot> alpha="3.51e-5"
> > gnuplot> beta="0.09400"
> > gnuplot> evie(alpha,beta)= `echo 90.0000 @alpha 0.00000 @beta 0.10000
> > 1|./eviegompertz` gnuplot>print evie(alpha,beta)
> > 4.230246
> >
> > where eviegompertz is a private C program which can't be simulated in
> > gnuplot and just output a value.
> >
> > Now I want to just "splot evie(x,y)" where x and y are variables and not
> > only fixed values. Is it possible to do it? I haven't seen such similar
> > examples. It may be trivial, sorry.
>
> Just use the system function:
>
> alpha = 3.51e-5
> beta = 0.09400
> evie(x, y) \
> = real(system("echo 90 %f 0 %f 0.1 1|./eviegompertz", x, y))
> print evie(alpha, beta)
>
> See "help functions system" for details.
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
gnuplot> help function system
Sorry, no help for 'function style system'
gnuplot>
I will upgrade from 4.2 to latest 4.3 and will tell you.
Nicolas
>
> 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
--
Brouard Nicolas <br...@in...>
|
|
From: Ethan M. <merritt@u.washington.edu> - 2008-03-14 19:16:47
|
On Friday 14 March 2008, Brouard Nicolas wrote:
> Le vendredi 14 mars 2008 à 17:42 +0100, Juergen Wieferink a écrit :
> > Hi,
> >
> > > gnuplot> alpha="3.51e-5"
> > > gnuplot> beta="0.09400"
> > > gnuplot> evie(alpha,beta)= `echo 90.0000 @alpha 0.00000 @beta
> > > 0.10000 1|./eviegompertz` gnuplot>print evie(alpha,beta)
> > > 4.230246
> > >
> > > where eviegompertz is a private C program which can't be simulated in
> > > gnuplot and just output a value.
> > >
> > > Now I want to just "splot evie(x,y)" where x and y are variables and
> > > not only fixed values. Is it possible to do it? I haven't seen such
> > > similar examples. It may be trivial, sorry.
> >
> > Just use the system function:
> >
> > alpha = 3.51e-5
> > beta = 0.09400
> > evie(x, y) \
> > = real(system("echo 90 %f 0 %f 0.1 1|./eviegompertz", x, y))
> > print evie(alpha, beta)
> >
> > See "help functions system" for details.
>
> 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
That means it is working, so far as gnuplot is concerned.
The error message is from the system, telling you that it is trying
to execute your numerical value as a command. Probably you
need additional quoting.
> warning: internal error--stack not empty!
> (function called with too many parameters?)
> 0.0
> gnuplot> help function system
> Sorry, no help for 'function style system'
> gnuplot>
>
> I will upgrade from 4.2 to latest 4.3 and will tell you.
> Nicolas
>
> > 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
--
Ethan Merritt
(on the road)
|
|
From: Juergen W. <wie...@fr...> - 2008-03-15 00:23:12
|
> 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.
Juergen
|
|
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
|