Method: Stick::Matrix#column2matrix
- Defined in:
- lib/stick/matrix.rb
#column2matrix(c) ⇒ Object
Returns the colomn/s of matrix as a Matrix
589 590 591 592 593 594 595 596 |
# File 'lib/stick/matrix.rb', line 589 def column2matrix(c) a = self.send(:column, c).to_a if c.is_a?(Range) and c.entries.size > 1 return Matrix[*a] else return Matrix[*a.collect{|x| [x]}] end end |