Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: how to get average of matrices' elements?

by Anonymous Monk
on Nov 30, 2016 at 19:07 UTC ( #1176965=note: print w/replies, xml ) Need Help??


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]]

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1176965]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2022-05-20 20:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (76 votes). Check out past polls.

    Notices?