help-octave
[Top][All Lists]
Advanced

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

Re: Is there a library/wrapper to expose .m files to the command line?


From: Francesco Potortì
Subject: Re: Is there a library/wrapper to expose .m files to the command line?
Date: Thu, 07 Apr 2016 11:08:26 +0200

>Is there a preferred way to expose a few .m files as programs from the
>command line?
>I know you could use either:
>
>  octave-cli --eval "myFunction(param1,param2)
>
>or:
>   #!/usr/bin/octave -qf
...
>$ myOctaveScript --param1=value --param2==value
>
>Would set variables param1 and param2 inside the script??

No.

>or I should process that myself with argv() ??

Yes, you should process them yourself using argv().  This is described
in the Executable Octave Programs page of the manual.

You can write a function that parses the line argument and uses
assignin('base', param, val) to set the parameters you want.

-- 
Francesco Potortì (ricercatore)        Voice:  +39.050.621.3058
ISTI - Area della ricerca CNR          Mobile: +39.348.8283.107
via G. Moruzzi 1, I-56124 Pisa         Skype:  wnlabisti
(entrance 20, 1st floor, room C71)     Web:    http://fly.isti.cnr.it




reply via email to

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