[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Passing values
From: |
Mike Miller |
Subject: |
Re: Passing values |
Date: |
Sun, 12 May 2002 14:11:26 -0500 (CDT) |
On Sun, 12 May 2002, sbt wrote:
> I want to pass variable values from a perl cgi script to an octave
> script in order to generate plots that my be dynamically created and
> viewed online. I am using Octave 2.0.16. Any advice on how to do this?
I have one imperfect answer and a similar question.
Imperfect answer:
Write the octave script so that it reads data from a file...
load -force octave_values.txt
...and parses that data accordingly. Write the file from the perl script.
Similar question:
In an octave script, can I use command-line arguments as in a shell
script. Simple example (which does not work):
#!/usr/local/bin/octave -q
x = $1 ;
x^2
I would call the script 'squared' and I'd call it like this:
squared 7
It would return 49 to stdout. The '$1' refers to the first argument on
the command line (following the command itself). Obviously, I've tried
this and the $1 syntax doesn't work.
Does Octave support this sort of thing?
Thanks in advance.
Mike
--
Michael B. Miller, Ph.D.
Assistant Professor
Division of Epidemiology
University of Minnesota
http://taxa.epi.umn.edu/~mbmiller/
-------------------------------------------------------------
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
-------------------------------------------------------------