Forum: Ruby Matrix in Ruby

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Minkoo S. (Guest)
on 2006-03-11 10:56
(Received via mailing list)
What is the best way to create a matrix whose size is m x n?
The value of m and n may be different, and the values in each cell
should be zeroed.

Can anybody help me?

Minkoo S.
Minkoo S. (Guest)
on 2006-03-11 14:31
(Received via mailing list)
I've found it by myself:

a = Matrix[(0..3).map { }]
unknown (Guest)
on 2006-03-11 17:16
(Received via mailing list)
On Sat, 11 Mar 2006, Minkoo S. wrote:

> I've found it by myself:
> a = Matrix[(0..3).map { }]

if you're going to be working with large matrices and doing lots of
crunching you'll want

   require 'narray'

   a = 3, 5

it's on the raa.


This topic is locked and can not be replied to.