1 ## Copyright (C) 1998-2012 Ariel Tankus
3 ## This file is part of Octave.
5 ## Octave is free software; you can redistribute it and/or modify it
6 ## under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation; either version 3 of the License, or (at
8 ## your option) any later version.
10 ## Octave is distributed in the hope that it will be useful, but
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 ## General Public License for more details.
15 ## You should have received a copy of the GNU General Public License
16 ## along with Octave; see the file COPYING. If not, see
17 ## <http://www.gnu.org/licenses/>.
20 ## @deftypefn {Function File} {[@var{r1}, @var{r2}, @dots{}, @var{rn}] =} deal (@var{a})
21 ## @deftypefnx {Function File} {[@var{r1}, @var{r2}, @dots{}, @var{rn}] =} deal (@var{a1}, @var{a2}, @dots{}, @var{an})
23 ## Copy the input parameters into the corresponding output parameters.
24 ## If only one input parameter is supplied, its value is copied to each
30 ## [a, b, c] = deal (x, y, z);
48 ## [a, b, c] = deal (x);
59 ## Author: Ariel Tankus
60 ## Author: Paul Kienzle and Etienne Grossman
64 function [varargout] = deal (varargin)
68 elseif (nargin == 1 || nargin == nargout)
69 varargout(1:nargout) = varargin;
71 error ("deal: nargin > 1 and nargin != nargout");