Skip to content

Commit

Permalink
correct sub2ind_loop() example
Browse files Browse the repository at this point in the history
  • Loading branch information
scheidan committed Nov 13, 2015
1 parent 7cda13f commit 627e681
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/manual/metaprogramming.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ indices - in other words, to calculate the index ``i`` that can be used to
index into an array ``A`` using ``A[i]``, instead of ``A[x,y,z,...]``. One
possible implementation is the following::

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

0 comments on commit 627e681

Please sign in to comment.