From: Paul Lutus Date: 2006-12-11T08:35:06+09:00 Subject: Re: Complete Newbie - Matrix Question Jay wrote: > Hi Folks, > This is probably quite easy, but I can't find a Matrix function or way > to populate a specific element of a matrix with a given value? ie, I > want to tell that element i,j of matrix.a should be 3 ------------------------------- #!/usr/bin/ruby -w require 'mathn' class Matrix def []=(i,j,v) @rows[i][j] = v end end m = Matrix.zero(5) m[2,2] = 3 p m ------------------------------- -- Paul Lutus http://www.arachnoid.com