How to create a vector from 1: n in C ++ (Armadillo)?
2 answers
Pay attention to this feature .
vec v = linspace<vec>(1, N);
Creates a vector starting at 1 and ending in N. It does exactly what you need.
+5
source to share