File: varargin.cat

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 (37 lines) | stat: -rw-r--r-- 1,333 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
varargin           Scilab Group           Scilab keyword           varargin
NAME
   varargin -  variable numbers of arguments in an input argument list
  
SYNTAX
   varargin must be the rightmost  argument of the function definition input
  list.
  
DESCRIPTION
   A function whose input argument list contains  varargin can be called
  with more input arguments than indicated in the input argument list. The
  calling arguments passed form varargin keyword onwards may then be
  retrieved within the function in a list named varargin.
  
   Suppose that varargin keyword is the n th argument of the formal input
  argument list, then if the function is called with less than n-1 input
  arguments the varargin list is not defined, if the function is called
  with n-1 arguments then varargin list is an empty list.  y = function
  ex(varargin) may be called with any number of input arguments. Within
  function  ex input arguments may be retrieved in varargin(i)
  ,i=1:length(varargin)
  
REMARK
   Named argument syntax like foo(...,key=value)  is incompatible with the
  use of varargin.
  
EXAMPLE
 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))
SEE ALSO
   function, varargout, list