On Mon, Aug 4, 2008 at 10:24 PM, Marcio Braga <mbraga0001 / gmail.com> wrote: >> http://www.ruby-lang.org/ja/man/html/Matrix.html#Matrix.23.5b.5d.3d >> Harry > > The example of that page: > > m=Matrix[[11,12],[21,22]] > m[1,1]=-1 > > ... gives me the following error message: > > undefined method '[]=' for Matrix[[11, 12], [21, 22]]:Matrix > (NoMethodError) You have to open the class and define the method as in the example... class Matrix def []=(i, j, x) @rows[i][j] = x end end Todd