Class: Matrix

Inherits:
Object
  • Object
show all
Defined in:
lib/grada/types/gnuplot.rb

Instance Method Summary collapse

Instance Method Details

#to_gplotObject



235
236
237
238
239
240
241
242
243
244
245
# File 'lib/grada/types/gnuplot.rb', line 235

def to_gplot
  matrix_for_plot = ''

  (0...self.column_size).each do |j|
    (0...self.row_size).each do |i|
      matrix_for_plot += "#{i} #{j} #{self[j,i]}\n" if self[j,i]
    end
  end

  matrix_for_plot
end