This forum has been archived. All content is frozen. Please use KDE Discuss instead.

setting a MatrixXf to zero

Tags: None
(comma "," separated)
hvn
Registered Member
Posts
4
Karma
0

setting a MatrixXf to zero

Wed Jul 17, 2013 9:26 am
Hi,

I have a MatrixXf of which I only know that the nr of cols is 7. Nr of rows is now 10 but may vary. When setting it to zero I used .Zero() but got the error that this is only applicable for fixed size matrices. So my question is if there is a way to get this done ? I also tried MatrixXf m(7,7); m.Zero(); but got the same error...

Thanks.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: setting a MatrixXf to zero  Topic is solved

Wed Jul 17, 2013 9:40 am
Matrix::Zero(r,c) is a static function returning a zero matrix of size r x c. You have to use mat.setZero() or mat = MatrixXf::Zero(rows, 10);


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]