http://qs1969.pair.com?node_id=1176965


in reply to Re: how to get average of matrices' elements?
in thread how to get average of matrices' elements?

That map is wrong, we're not building a hash. Just use $m_avrg[$i] = [ (0) x 3 ];
  • Comment on Re^2: how to get average of matrices' elements?

Replies are listed 'Best First'.
Re^3: how to get average of matrices' elements?
by toolic (Bishop) on Nov 30, 2016 at 19:13 UTC
    That map is wrong, we're not building a hash.
    Please try running my code before you make such a claim. My code creates an array-of-arrays data structure with all elements initialized to 0.

    UPDATE: see my updated code.

      I did run your code. Here's the output from Data::Dump:
      [[1, 0, 2, 0, 3, 0], [1, 0, 2, 0, 3, 0], [1, 0, 2, 0, 3, 0]]