comparison scripts/general/accumdim.m @ 14116:951eacaf9381 stable

Initial documentation for broadcasting and general vectorization guidelines * vectorize.txi: New file. * NEWS: Update with location of broadcasting documentation. * Makefile.am: Add vectorize.texi * arith.txi: Move accumarray and accumdim docstring to vectorize.txi * container.txi: Move structfun docstring to vectorize.txi * expr.txi: Mention broadcasting where relevant. * func.txi: Move vectorize docstring to vectorize.txi * matrix.txi: Move function application section to vectorize.txi * octave.texi: Add vectorize.txi and its menu options * sparse.txi: Move spfun to vectorize.txi * tips.txi: Move and rewrite coding tips section in vectorize.txi * bsxfun.h (is_valid_bsxfun, is_valid_inplace_bsxfun): Rename warning to "Octave:broadcast" * accumdim.m: Reformat to use @example in lieu of @smallexample * warning_ids.m: Add Octave:broadcast * bsxfun.cc: Reword docstring to mention broadcasting * cellfun.cc: Move comment about efficiency from tips.txi * version.h.in: Add a big startup warning about broadcasting
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Tue, 27 Dec 2011 15:15:41 -0500
parents dac62c415e8b
children 94e2a76f1e5a
comparison
equal deleted inserted replaced
14115:0b3518c1228a 14116:951eacaf9381
41 ## with them are set to zero. Defining @var{fillval} to some other 41 ## with them are set to zero. Defining @var{fillval} to some other
42 ## value allows these values to be defined. 42 ## value allows these values to be defined.
43 ## 43 ##
44 ## An example of the use of @code{accumdim} is: 44 ## An example of the use of @code{accumdim} is:
45 ## 45 ##
46 ## @smallexample 46 ## @example
47 ## @group 47 ## @group
48 ## accumdim ([1, 2, 1, 2, 1], [ 7, -10, 4; 48 ## accumdim ([1, 2, 1, 2, 1], [ 7, -10, 4;
49 ## -5, -12, 8; 49 ## -5, -12, 8;
50 ## -12, 2, 8; 50 ## -12, 2, 8;
51 ## -10, 9, -3; 51 ## -10, 9, -3;
52 ## -5, -3, -13]) 52 ## -5, -3, -13])
53 ## @result{} ans = [-10,-11,-1;-15,-3,5] 53 ## @result{} ans = [-10,-11,-1;-15,-3,5]
54 ## @end group 54 ## @end group
55 ## @end smallexample 55 ## @end example
56 ## 56 ##
57 ## @seealso{accumarray} 57 ## @seealso{accumarray}
58 ## @end deftypefn 58 ## @end deftypefn
59 59
60 function A = accumdim (subs, vals, dim, n = 0, func = [], fillval = 0) 60 function A = accumdim (subs, vals, dim, n = 0, func = [], fillval = 0)