Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/matlab/driver/native/conversions.rb

Instance Method Summary collapse

Instance Method Details

#to_cell_matrixObject

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