From: "Brian Schröder" Date: 2005-11-28T22:49:59+09:00 Subject: Re: 2dim array/matrix On 28/11/05, Wolfgang wrote: > Thanks for the answers, > > I think I will use for the beginning this solution: > mx = Array.new(dim_x) { Array.new(dim_y) } > > for the matrix class: > I don't understand how I can set in a matrix single values: > require "matrix" > m=Matrix[ [25, 93], [-1, 66] ] > puts m.[](1,1) > this works but when I try: > m.[](1,1)=123 > puts m > I only get an error. > > Wolfgang > > Try these: puts m[1,1] m[1,1] = 123 pits m[1,1] brian -- http://ruby.brian-schroeder.de/ Stringed instrument chords: http://chordlist.brian-schroeder.de/