Made matrix class iterable.