38

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)?

Michael Graczyk
  • 4,905
  • 2
  • 22
  • 34
R.J.
  • 1,413
  • 2
  • 13
  • 18

1 Answers1

60

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<>.

R.J.
  • 1,413
  • 2
  • 13
  • 18