Class: Hash

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

Instance Method Summary collapse

Instance Method Details

#to_matlabObject

Converts the hash into a 1 Dimensional MATLAB struct matrix



81
82
83
84
85
86
87
88
89
# File 'lib/matlab/driver/native/conversions.rb', line 81

def to_matlab
  struct_matrix = Matlab::StructMatrix.new(1, 1, *keys)
  
  each do |(key, value)|
    struct_matrix[0,0][key] = value
  end
  
  struct_matrix.to_matlab
end