In this article, we consider the ergodic optimization of the top Lyapunov exponent. We prove that there is a unique maximising measure of top Lyapunov expoent for typical matrix cocyles. By using the results we obtain, we prove that in any non-uniquely ergodic minimal dynamical system, the Lyapunov-irregular points are typical for typical matrix cocyles.