Created
September 18, 2015 09:31
-
-
Save devhero/a79978d69303b57c9cf7 to your computer and use it in GitHub Desktop.
add a row to matrix - http://stackoverflow.com/questions/16011252/add-a-row-array-to-an-empty-matrix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2.0.0p0 :001 > require 'matrix' | |
=> true | |
2.0.0p0 :002 > m = Matrix[] | |
=> Matrix.empty(0, 0) | |
2.0.0p0 :003 > m = Matrix.rows(m.to_a << [1,2,3]) | |
=> Matrix[[1, 2, 3]] | |
2.0.0p0 :004 > m = Matrix.rows(m.to_a << [2,3,4]) | |
=> Matrix[[1, 2, 3], [2, 3, 4]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment