Skip to content

Commit 627e681

Browse files
committed
correct sub2ind_loop() example
1 parent 7cda13f commit 627e681

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/manual/metaprogramming.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ indices - in other words, to calculate the index ``i`` that can be used to
10361036
index into an array ``A`` using ``A[i]``, instead of ``A[x,y,z,...]``. One
10371037
possible implementation is the following::
10381038

1039-
function sub2ind_loop(dims::NTuple{N}, I::Integer...)
1039+
function sub2ind_loop{N}(dims::NTuple{N}, I::Integer...)
10401040
ind = I[N] - 1
10411041
for i = N-1:-1:1
10421042
ind = I[i]-1 + dims[i]*ind

0 commit comments

Comments
 (0)