From: Peter Bunyan Date: 2008-09-12T04:02:37+09:00 Subject: Re: How to operate on 2 arrays simultaneously? Patrick Doyle wrote: > There has got to be a more elegant solution than this. Suppose I have > 2 identical length arrays that I want to add together to produce a > third array. The best solution I've come up with is: > > c = (0...a.size).map {|i| a[i] + b[i]} > > Any suggestions? > > --wpd http://www.ruby-doc.org/stdlib/libdoc/matrix/rdoc/classes/Matrix.html -- Posted via http://www.ruby-forum.com/.