help-octave
[Top][All Lists]
Advanced

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

Newbie question: passing string variable to gset


From: James W. Haefner
Subject: Newbie question: passing string variable to gset
Date: Sun, 20 Feb 2005 13:12:35 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030701

Hello,
Very basic question I'm sure: I want to prompt the user for a filename and have gnuplot output go to that file name.

I'm using octave 2.1.40 and gnuplot 4.0 (same problem with gnuplot 3.57)

Here is the code that fails:

gset term push;
gset terminal postscript;
fflush(stdout);
% this next line fails to get a value in fname...
 %fname=input("Enter a filename of PDF outp","s");
% this line reads the string
[fname]=scanf('%s',"C");
fflush(stdout);
disp(fname);
% this line fails
gset output fname;
% this line works of course
gset output "test.ps";
plot(t,y(:,2));
gset term pop;



The error message is:

gnuplot> set output fname
                    ^
         line 0: expecting filename

Thanks for any help.
--
Jim Haefner



-------------------------------------------------------------
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
-------------------------------------------------------------



reply via email to

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