From Matlab to C++ Eigen matrix operations - vector normalization
Converting some Matlab code to C++. Questions (how to in C++): Concatenate two vectors in a matrix. (already found the solution) Normalize each array ("pts" col) dividing it by its 3rd value Matlab code for 1 and 2: % 1. A 3x1 vector. d0, d1 double. B = [d0*A (d0+d1)*A]; % B is 3x2 % 2. Normalize a set of 3D points % Divide each col by its 3rd value % pts 3xN. C 3xN. % If N = 1 you can do: C = pts./pts(3); if not: C = bsxfun(@rdivide, pts, pts(3,:)); C++ code for 1 and 2: // 1. Found the solution for that one! B << d0*A, (d0 + d1)*A; // 2. for (int i=0, i<N; i++) { // Something like this, but