Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/matlab/driver/native/conversions.rb
Instance Method Summary collapse
-
#to_cell_matrix ⇒ Object
Flattens and converts the array to a 1 Dimensional Matlab::CellMatrix.
Instance Method Details
#to_cell_matrix ⇒ Object
Flattens and converts the array to a 1 Dimensional Matlab::CellMatrix
48 49 50 51 52 53 54 55 56 |
# File 'lib/matlab/driver/native/conversions.rb', line 48 def to_cell_matrix values = flatten cell_matrix = Matlab::CellMatrix.new(values.size, 1) values.each_with_index do |value, index| cell_matrix[index, 0] = value end cell_matrix end |