@@ -279,7 +279,7 @@ julia> [(i,j) for i=1:3 for j=1:i if i+j == 4]
279279
280280## [ Indexing] (@id man-array-indexing)
281281
282- The general syntax for indexing into an n-dimensional array A is:
282+ The general syntax for indexing into an n-dimensional array ` A ` is:
283283
284284```
285285X = A[I_1, I_2, ..., I_n]
@@ -410,7 +410,7 @@ julia> searchsorted(a, 4)
410410
411411## Assignment
412412
413- The general syntax for assigning values in an n-dimensional array A is:
413+ The general syntax for assigning values in an n-dimensional array ` A ` is:
414414
415415```
416416A[I_1, I_2, ..., I_n] = X
@@ -422,10 +422,17 @@ where each `I_k` may be a scalar integer, an array of integers, or any other
422422ranges of the form ` a:c ` or ` a:b:c ` to select contiguous or strided
423423subsections, and arrays of booleans to select elements at their ` true ` indices.
424424
425- If ` X ` is an array, it must have the same number of elements as the product of the lengths of
426- the indices: ` prod(length(I_1), length(I_2), ..., length(I_n)) ` . The value in location ` I_1[i_1], I_2[i_2], ..., I_n[i_n] `
427- of ` A ` is overwritten with the value ` X[i_1, i_2, ..., i_n] ` . If ` X ` is a scalar, use the
428- element-wise assignment operator ` .= ` to write the value to all referenced locations of ` A ` :
425+ If all indices ` I_k ` are integers, then the value in location ` I_1, I_2, ..., I_n ` of ` A ` is
426+ overwritten with the value of ` X ` , [ converting] (@ref ` convert ` ) to the [ element type] (@ref
427+ ` eltype ` ) of ` A ` if necessary.
428+
429+ If any index ` I_k ` selects more than one location, then the right hand side ` X ` must be an
430+ array with the same shape as the result of indexing ` A[I_1, I_2, ..., I_n] ` or a vector with
431+ the same number of elements. The value in location ` I_1[i_1], I_2[i_2], ..., I_n[i_n] ` of
432+ ` A ` is overwritten with the value ` X[I_1, I_2, ..., I_n] ` , converting if necessary. The
433+ element-wise assignment operator ` .= ` may be used to [ broadcast] (@ref man-broadcasting) ` X `
434+ across the selected locations:
435+
429436
430437```
431438A[I_1, I_2, ..., I_n] .= X
@@ -714,7 +721,7 @@ Also notice the difference between `max.(a,b)`, which [`broadcast`](@ref)s [`max
714721elementwise over ` a ` and ` b ` , and [ ` maximum(a) ` ] ( @ref ) , which finds the largest value within
715722` a ` . The same relationship holds for ` min.(a,b) ` and ` minimum(a) ` .
716723
717- ## Broadcasting
724+ ## [ Broadcasting] ( @ id man-broadcasting)
718725
719726It is sometimes useful to perform element-by-element binary operations on arrays of different
720727sizes, such as adding a vector to each column of a matrix. An inefficient way to do this would
0 commit comments