Registered Member
|
I read the tutorial, but I couldn't find element by element multiply and divide, I need a simple function just like .* or ./ in Matlab or Octave, this function means multiply two same size matrix element by element
Can any one tell me how to manipulate it? |
Registered Member
|
If mat1 and mat2 are of type Matrix, you can do either mat1.cwiseProduct(mat2) to get the component-wise product. Similarly, mat1.cwiseQuotient(mat2) gives component-wise division.
If arr1 and arr2 are of type Array, you can simply do arr1 * arr2 and arr1 / arr2. I think "Tutorial page 3 - The Array class and coefficient-wise operations" at http://eigen.tuxfamily.org/dox-devel/Tu ... Class.html explains all this. |
Registered users: Baidu [Spider], Bing [Bot], Google [Bot], rblackwell