help-octave
[Top][All Lists]
Advanced

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

Re: problem passing variable to gnuplot


From: Dirk Eddelbuettel
Subject: Re: problem passing variable to gnuplot
Date: Thu, 22 Jan 1998 19:53:42 -0500 (EST)

  Ray> If I just put the number in the gnuplot command everything works as I
  Ray> expect with no error:
  Ray>         
  Ray>         octave:24> gset xrange [1:2] 
  Ray>         octave:25>
  Ray>  
  Ray>  What is the proper way to accomplish the passing of variable
  Ray> arguments to gnuplot?

You can use eval on the return from sprintf as in 

        octave:1> eval(sprintf("gset xrange [%d:%d]", 2, 3))
        octave:2> plot((1:10))
                        (creates window with a straight line between 2 and 3
                         as selected by gset)

Regards, Dirk

-- 
address@hidden                   According to the latest official figures, 
http://rosebud.ml.org/~edd        43% of all statistics are totally worthless.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]