help-octave
[Top][All Lists]
Advanced

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

Re: Command line parameters


From: fork
Subject: Re: Command line parameters
Date: Tue, 26 Apr 2011 20:36:31 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Daryl Lee <daryl <at> daryllee.com> writes:

> 
>  When I am at the Octave 
> prompt and type "myscript arg1 arg2" I get "error: i

There is a vocabulary issue here, I think:

"scripts" (version 1) are files with octave code that is run from the octave
prompt as if they had been "sourced". The octave session is the scope for these
files, so they just see the currently assigned variables and assign variables
that can be seen after the script falls off the end of the file.  They don't
take parameters, they just run in current scope. argv and friends are
(basically) meaningless when run this way.  You generally don't want to use them

"scripts" (version 2) are executable files run from the _shell_ prompt, which
have to handle input parameters from outside octave; argv etc are used here. 
These are very useful, since they allow real math processing in the unix
environment.  

"functions" are, well, functions that take parameters using the traditional
f(x,y) syntax we all love so well.  These can _only_ be run within an octave
session or a script; they can't be run from the shell prompt.




reply via email to

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