Question

How can I access a single vector from a matrix?

For example: Is there a way to extract a vector using something like A(i) for a matrix Eigen::MatrixXf A(10,10) that returns an Eigen::VectorXf A(10)?

Was it helpful?

Solution

Found in the documentation :/ The way to access a single column is .col(i), and similarly for row, its .row(i). Also of interest is .block<>.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top