function [index] = index_1d(index_row, index_column, no_rows)
%index_1d returns the 1-d index of a set of points in a matrix.  The
%function is passed 2 vectors, containing the row and column indices and
%a scalar giving the number of rows in the matrix.  The 1 dimension
%indices are required for replacement excercises, e.g,
%a(index) = 1000*ones(size(index));

%     Copyright J. V. Mansbridge, CSIRO, Fri Aug 12 16:52:33 EST 1994

if (size(index_row) - size(index_column)) == [0 0]
  index = index_row + no_rows*(index_column - 1);
else
  error('index_coords: index_row and index_column must be the same size')
end
