I have learnt that matrix mechanics came before Schroedinger's wave mechanics, however introductory quantum mechanics textbooks introduce you to wave mechanics first. The way in which the transition to matrix mechanics is made is by defining the matrix elements:
$$ H_{mn} = \int _{-\infty}^{+\infty} \psi_m^* \hat{H} \psi_n ~\mathrm dV $$
but these elements are defined using a wavefunction. How did Heisenberg (and others too) come up with matrix mechanics and what was the motivation?
I have seen the application of matrix mechanics to angular momentum but how would I apply it to a simple system like a particle trapped in an infinite potential well without starting from the wave mechanics point of view?