Registered Member
|
Hi,
Is there a way(except using a for loop) to skip elements when accessing the elements in a vector or matrix using Eigen ? I'm using Visual Studio 2013 and I'm programming in C++. I'm looking for an equivalent of A(1:2:p) in MATLAB which will give me every other element in an arbitrary vector A. |
Registered Member
|
Yes, using a Eigen::Map and setting the Eigen::Stride parameter to "2".
|
Moderator
|
To complete the previous answer:
output:
|
Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft