~ubuntu-branches/ubuntu/karmic/scilab/karmic

« back to all changes in this revision

Viewing changes to man/functions/varargin.cat

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
varargin           Scilab Group           Scilab keyword           varargin
 
2
NAME
 
3
   varargin -  variable numbers of arguments in an input argument list
 
4
  
 
5
SYNTAX
 
6
   varargin must be the rightmost  argument of the function definition input
 
7
  list.
 
8
  
 
9
DESCRIPTION
 
10
   A function whose input argument list contains  varargin can be called
 
11
  with more input arguments than indicated in the input argument list. The
 
12
  calling arguments passed form varargin keyword onwards may then be
 
13
  retrieved within the function in a list named varargin.
 
14
  
 
15
   Suppose that varargin keyword is the n th argument of the formal input
 
16
  argument list, then if the function is called with less than n-1 input
 
17
  arguments the varargin list is not defined, if the function is called
 
18
  with n-1 arguments then varargin list is an empty list.  y = function
 
19
  ex(varargin) may be called with any number of input arguments. Within
 
20
  function  ex input arguments may be retrieved in varargin(i)
 
21
  ,i=1:length(varargin)
 
22
  
 
23
REMARK
 
24
   Named argument syntax like foo(...,key=value)  is incompatible with the
 
25
  use of varargin.
 
26
  
 
27
EXAMPLE
 
28
 deff('exampl(a,varargin)',['[lhs,rhs]=argn(0)'
 
29
                           'if rhs>=1 then disp(varargin),end'])
 
30
 exampl(1)
 
31
 exampl()
 
32
 exampl(1,2,3)
 
33
 l=list('a',%s,%t);
 
34
 exampl(1,l(2:3))
 
35
SEE ALSO
 
36
   function, varargout, list
 
37