简体   繁体   English

如何从特征矩阵列/行中获取特征向量?

[英]How to get an Eigen vector from an Eigen matrix column/row?

The thing I want to do is this:我想做的是这样的:

MatrixXd M;
// Whatever assigned to `X`
VectorXd V = M(1);

Eigen does not support this.本征不支持这一点。 Is there a way to retrieve an Eigen vector from an Eigen matrix?有没有办法从特征矩阵中检索特征向量?

Eigen Slicing and Indexing is of much use here.特征切片和索引在这里很有用。

To retrieve an i -th row vector:要检索第i行向量:

VectorXd V = M(i, all);

To retrieve an i -th column vector:要检索第i个列向量:

VectorXd V = M(all, i);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM