?eachindex A = rand(3, 4) for i in eachindex(A) @show i, A[i] end ?CartesianIndex ?CartesianIndices function f!(A::AbstractMatrix) for CI in CartesianIndices(A) i, j = CI.I @show CI, i, j, A[CI] A[CI] = i * j end end f!(A) A