Mercurial > hg > octave-avbm
changeset 16191:049c769b11c5
celldisp.m: Tweak docstring and error message.
* scripts/general/celldisp.m: Tweak docstring and error message.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 04 Mar 2013 19:00:00 -0800 |
parents | 2825897a0c27 |
children | 741dbca67d80 |
files | scripts/general/celldisp.m |
diffstat | 1 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/general/celldisp.m +++ b/scripts/general/celldisp.m @@ -17,7 +17,8 @@ ## <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn {Function File} {} celldisp (@var{c}, @var{name}) +## @deftypefn {Function File} {} celldisp (@var{c}) +## @deftypefnx {Function File} {} celldisp (@var{c}, @var{name}) ## Recursively display the contents of a cell array. By default the values ## are displayed with the name of the variable @var{c}. However, this name ## can be replaced with the variable @var{name}. For example: @@ -44,12 +45,13 @@ ## This is ugly, but seems to be what matlab does.. function celldisp (c, name) + if (nargin < 1 || nargin > 2) print_usage (); endif if (! iscell (c)) - error ("celldisp: argument must be a cell array"); + error ("celldisp: C must be a cell array"); endif if (nargin == 1) @@ -83,7 +85,7 @@ %! c = {1, 2, {31, 32}}; %! celldisp (c, "b") +## Test input validation %!error celldisp () %!error celldisp ({}, "name", 1) -%!error celldisp (1) - +%!error <C must be a cell array> celldisp (1)