Multidimensional Matrix array is like this
arr1 = Matrix[[0.9742006046104146, 0.9164380106962612, 0.39571440216724874],
[1.3793903493310324, 1.8988033906016721, 1.2768961254764901],
[0.42334074004480604, 1.6728495387871951, 1.2575501206006443]]
Another simple array is like this
arr2 = Matrix[[0.13054527963360518, 0.8579042642337861, 0.3041160868559809]]
I can't add both together, arr1 + arr2
ExceptionForMatrix::ErrDimensionMismatch: Matrix dimension mismatch
from /home/arjun/.rbenv/versions/2.2.3/lib/ruby/2.2.0/matrix.rb:996:in `+'
from (irb):171
from /home/arjun/.rbenv/versions/2.2.3/bin/irb:11:in `<main>'
How can I do it. In python/numpy simply doing an addition just works?
What is the Ruby equivalent?
NOTE -
arr1
is the dot product of Matrix[*a] * Matrix[*b]
, if that matters