![]() |
Exploiting MATLAB's Data Structures |
varargin and varargout are
normal cell arrays that can be accessed and manipulated with the normal
cell array syntax. That is, varargin{i} retrieves the i-th element, varargin{:}
is a comma-separated list, etc.
varargout must show up as the last element in the
output argument declaration of a function to be automatically mapped to
the output arguments. It is ok to define more elements in varargout
than nargout indicates were requested when the function
was called. This is required when you want to always set ans
when no outputs are requested. In this case set varargout{1}
to your output value.
for loops are commonly required when dealing with
cell arrays. The function explode isn't vectorizable.
![]()
Copyright © 1997 The MathWorks,
Inc.
clay@mathworks.com
$Revision$ $Date$