function c=i2c(i) global m n dims = repmat(m,[1 n]); c = ind2coord(i,dims); return