Simple method for getting indices of a sub array along top, bottom or side of larger matrix A?

Thank you