[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: input variables form the shell
From: |
c. |
Subject: |
Re: input variables form the shell |
Date: |
Thu, 1 Mar 2012 23:15:00 +0530 |
On 1 Mar 2012, at 22:21, jacopo rocchi wrote:
> yes but in the octave script shouldn't I use some kind of argv function to
> save the value 2.0 I give in input in the variable ARG?
no, if you use the --eval option Octave will just parse the string you pass
as if it were written at the Octave prompt, so "2.0" will be recognized as a
real
number and will be set as the value of the first input parameter of the
function "script (ARG)" defined in the file "script.m" therefore
octave -qf --eval "script (2.0)"
is equivalent to
$ octave -qf
> script (2.0)
there is no need to use "argv" if you do it like this
> thanks
c.