# HG changeset patch # User Jordi GutiƩrrez Hermoso # Date 1325777644 18000 # Node ID f1ff06a1d73a8bebfa01f9a521b1322eb3f4b679 # Parent 402acc45350e1ea32340491e12d3c5a4f3d5c500 doc: Mention broadcasting in more relevant places. diff -r 402acc45350e -r f1ff06a1d73a doc/interpreter/expr.txi --- a/doc/interpreter/expr.txi Thu Jan 05 10:27:34 2012 -0500 +++ b/doc/interpreter/expr.txi Thu Jan 05 10:34:04 2012 -0500 @@ -519,8 +519,7 @@ @item @var{x} + @var{y} @opindex + Addition. If both operands are matrices, the number of rows and columns -must both agree. If one operand is a scalar, its value is added to -all the elements of the other operand. +must both agree, or they must be broadcastable to the same shape. @item @var{x} .+ @var{y} @opindex .+ @@ -529,20 +528,23 @@ @item @var{x} - @var{y} @opindex - Subtraction. If both operands are matrices, the number of rows and -columns of both must agree. +columns of both must agree, or they must be broadcastable to the same +shape. @item @var{x} .- @var{y} Element by element subtraction. This operator is equivalent to @code{-}. @item @var{x} * @var{y} @opindex * -Matrix multiplication. The number of columns of @var{x} must agree -with the number of rows of @var{y}. +Matrix multiplication. The number of columns of @var{x} must agree with +the number of rows of @var{y}, or they must be broadcastable to the same +shape. @item @var{x} .* @var{y} @opindex .* -Element by element multiplication. If both operands are matrices, the -number of rows and columns must both agree. +Element by element multiplication. If both operands are matrices, the +number of rows and columns must both agree, or they must be +broadcastable to the same shape. @item @var{x} / @var{y} @opindex / @@ -599,8 +601,9 @@ @itemx @var{x} .** @var{y} @opindex .** @opindex .^ -Element by element power operator. If both operands are matrices, the -number of rows and columns must both agree. +Element by element power operator. If both operands are matrices, the +number of rows and columns must both agree, or they must be +broadcastable to the same shape. @item -@var{x} @opindex -