Created
May 30, 2012 19:47
-
-
Save ecleel/2838528 to your computer and use it in GitHub Desktop.
Example of how use matrix class in ruby
This file contains hidden or 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
require 'matrix' | |
require 'pp' | |
a = Matrix[ [1,2], [3,4]] | |
b = Matrix[ [4,3], [2,1]] | |
pp a | |
pp b | |
pp a * b | |
pp a / b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment