function [index_row, index_column] = index_2d(index, no_rows)
%Find row and column indices of a set of points, given some 1-d indices.
%index_2d returns 2 vectors, containing the row and column indices
%of a set of points.  The
%function is passed a vector, containing the 1-d indices and
%a scalar giving the number of rows in the matrix.

%     Copyright J. V. Mansbridge, CSIRO, Tue Sep  6 15:06:51 EST 1994

index_column = floor((index - 1)/no_rows) + 1;
index_row = index - no_rows*(index_column - 1);
