function [R,C] = find_ind(M,ind)
  %finds the row and column number of a matrix M given its numeric index ind.
  
  R_total = rows(M);    %Total rows in M
  
  C = ceil(ind/R_total);    %Column number
  R = ind - (C-1)*R_total;    %Row number

  printf('\nRow Number: %u\nColumn Number: %u\n\n',R,C)