brewersfan1976

extract_matrix_column.rb

Feb 26th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.25 KB | None | 0 0
  1. def extractMatrixColumn(matrix, column)
  2.     array_length = matrix.length
  3.     new_array = Array.new
  4.     x = 0
  5.    
  6.     while (x < array_length)
  7.         new_array[x] = matrix[x][column]
  8.         x = x + 1
  9.     end
  10.    
  11.     return new_array
  12. end
Advertisement
Add Comment
Please, Sign In to add comment