From help-octave-request at bevo dot che dot wisc dot edu Wed Jan 30 10:34:47 2002 Subject: Re: plot to file from executable script -problem refined From: Rafael Laboissiere To: help-octave at bevo dot che dot wisc dot edu Date: Wed, 30 Jan 2002 10:34:25 -0600 * Pieter Thysebaert [2002-01-30 10:32]: > I did not add gset output "output.eps" as a command, but rather > > filename="output.eps"; > gset output filename > > [...] > > However, gnuplot seems to choke on it: > It says "filename expected", so I suppose octave is passing the variable name > rather than the contents of it (=the filename). It is not gnuplot that is choking on it, it is the Octave parser itself. > Can I plot to a file if its name is to be determined at run-time ? Sure you can. Try: eval(sprintf("gset output \"%s\", filename)) -- Rafael ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------