diff scripts/miscellaneous/substruct.m @ 10122:9d1a14e12431

Update docs and add tests for container functions
author Thorsten Meyer <thorsten.meyier@gmx.de>
date Sun, 17 Jan 2010 13:31:42 +0100
parents fbf15a0f30f0
children b122dd3075ce
line wrap: on
line diff
--- a/scripts/miscellaneous/substruct.m
+++ b/scripts/miscellaneous/substruct.m
@@ -19,7 +19,27 @@
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} substruct (@var{type}, @var{subs}, @dots{})
 ## Create a subscript structure for use with @code{subsref} or
-## @code{subsasgn}.
+## @code{subsasgn}. For example:
+##
+## @example
+## @group
+## idx = substruct("()", @{3, ":"@})
+##      @result{}
+##        idx =
+##        @{
+##          type = ()
+##          subs =
+##          @{
+##            [1,1] =  3
+##            [1,2] = :
+##          @}
+##        @}
+## x = [1, 2, 3; 4, 5, 6; 7, 8, 9];
+## subsref(x, idx)
+##      @result{} ans = 
+##         7  8  9
+## @end group
+## @end example
 ## @seealso{subsref, subsasgn}
 ## @end deftypefn