help-octave
[Top][All Lists]
Advanced

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

Re: Octave on Mac (Intel): GNUplot problem


From: Stuart Edwards
Subject: Re: Octave on Mac (Intel): GNUplot problem
Date: Wed, 14 Oct 2009 14:40:51 -0400

Thanks for your response.

Here's the first few lines of the script seshaft.m  .....

        #!/usr/local/bin/octave
        # A script ......
        #blah...
        #blah...

        #clear all the current variables

        clear all

        #get the name of a new file for this run

        filename = input("name of new run  ","s")

Trying to run the script from the directory where it resides ..

        SEsMacPro:seshaft stu$ ./seshaft.m

        <about 15 line feeds>

        ./seshaft.m: line 13: syntax error near unexpected token `('
        ./seshaft.m: line 13: `filename = input("name of new run  ","s")'


Checking the path to octave in the shebang line ..

        SEsMacPro:seshaft stu$ /usr/local/bin/octave
        GNU Octave, version 3.2.2
        etc
        etc

Manually starting the script from within octave ..

        octave-3.2.2:1> seshaft
        name of new run  testtest
        filename = testtest

So the parts seem to run independently but not together.

Adding: print -deps "plot.eps" doesn't seem to have any effect on the script when I run it 'manually'.

Thanks for your help.

Stu

On Oct 14, 2009, at 12:59 PM, Leo Butler wrote:



On Wed, 14 Oct 2009, Stuart Edwards wrote:

< Interesting .... I have the same problem. I have written some octave
< scripts with the same octave shebang line and when I run it -
< nothing.  If I run the shebang line (minus the #!) from the command
< line, octave opens.  Then if I start the script it runs fine.  But
< I've never been able to start it 'automatically' as originally intended.
<
< Mac OSX 10.5 an 10.6.1
< Octave 3.2.2
< Aquaterm 1.0.1
< Gnuplot 4.0
<
< Stu
<
<
< On Oct 14, 2009, at 10:30 AM, Vic Norton wrote:
<
< > Hi Thomas,
< >
< > I'm running Octave 3.2.3 and Gnuplot 4.2.6 on Mac OSX 10.6.1. These < > Octave and Gnuplot live in Octave.app and Gnuplot.app respectively.
< >
< > The plotting commands
< >   x=0:0.1:2*pi;
< >   plot(2*sin(x));
< >   plot3(sin(x), cos(x), x);
< > work perfectly (via Aquaterm) when I run Octave interactively.
< >
< > On the other hand I often use Octave and Gnuplot (separately) via the
< > shebang lines
< >   #!/usr/local/bin/octave
< >   #!/usr/local/bin/gnuplot
< > The octave and gnuplot files here are symbolic links to the
< > corresponding files in the Octave and Gnuplot applications. On my
< > system calling gnuplot from octave via the shebang line:
< >   #!/usr/local/bin/octave
< >   x=0:0.1:2*pi;
< >   plot(2*sin(x));
< >   plot3(sin(x), cos(x), x);
< > produces nothing. What do I need to add to make this octave/ gnuplot
< > combination work? Am I just missing some output file line?

When you say 'produces nothing' do you mean that octave starts up and
then exits without apparently opening a plot window?

What happens when you add

print -deps "plot.eps";

to the bottom of your script?

Leo

--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




reply via email to

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