File: varargin.man

package info (click to toggle)
scilab 2.6-4
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 54,632 kB
  • ctags: 40,267
  • sloc: ansic: 267,851; fortran: 166,549; sh: 10,005; makefile: 4,119; tcl: 1,070; cpp: 233; csh: 143; asm: 135; perl: 130; java: 39
file content (38 lines) | stat: -rw-r--r-- 1,392 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
.TH varargin 1 "April 1998" "Scilab Group" "Scilab keyword"
.so ../sci.an
.SH NAME
varargin -  variable numbers of arguments in an input argument list
.SH SYNTAX
\fVvarargin\fR must be the rightmost  argument of the function definition
input list.
.SH DESCRIPTION
A function whose input argument list contains  \fVvarargin\fR can be
called with more input arguments than indicated in the input argument
list. The calling arguments passed form \fVvarargin\fR keyword onwards
may then be retrieved within the function in a list named
\fVvarargin\fR.
.LP
Suppose that \fVvarargin\fR keyword is the \fVn\fR th argument of the
formal input argument list, then if the function is called with less
than \fVn-1\fR input arguments the \fVvarargin\fR list is not defined,
if the function is called with \fVn-1\fR arguments then \fVvarargin\fR
list is an empty list.

\fVy = function ex(varargin)\fR may be called with any number of input
arguments. Within function  \fVex\fR input arguments may be retrieved
in \fVvarargin(i)\fR ,\fVi=1:length(varargin)\fR
.SH REMARK
Named argument syntax like \fVfoo(...,key=value) \fR is incompatible
with the use of varargin.
.SH EXAMPLE
.nf
deff('exampl(a,varargin)',['[lhs,rhs]=argn(0)'
                          'if rhs>=1 then disp(varargin),end'])
exampl(1)
exampl()
exampl(1,2,3)
l=list('a',%s,%t);
exampl(1,l(2:3))
.fi
.SH SEE ALSO
function, varargout, list