[Top][All Lists]

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

Re: command-line like arguments at the octave prompt?

From: CdeMills
Subject: Re: command-line like arguments at the octave prompt?
Date: Mon, 30 Aug 2010 00:53:35 -0700 (PDT)

Mike B.-2 wrote:
> The octave manual mentions it is possible to provide command line
> arguments at the shell prompt, for example:
> octave myfile.m a b c
> Is it possible to do the same for a script (not a function) at the octave
> prompt, for example:
> 1:>myfile a b c

A script is a collection of octave commands, and as such does not have
arguments. May be you're thinking about functions that may be encountered
under two forms:
hold on

This result can be achieved by:
function resu = myfunc(varargin)

resu = varargin;


which can be used as
myfunc string1 string2
myfunc('string1', 'string2')

The drawback is that, in the first case, the arguments are passed as string: 
myfunc x
receives the string 'x', not the content of the variable x.


View this message in context:
Sent from the Octave - General mailing list archive at

reply via email to

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