4 ms·
Pick out the even (i,j where both even) elements from a matrix m[0::2, 0::2] // Numpy m(0::2, 0::2) // Fo
by sampo 3y ago
Pick out the even (i,j where both even) elements from a matrix
m[0::2, 0::2] // Numpy
m(0::2, 0::2) // Fortran [1]
m(seq(0, last, 2), seq(0, last, 2)) // C++ Eigen
[1] If you have declared the array to start indexing from 0.