.
We relate Nekrasov partition functions, with arbitrary values of $\epsilon_1,\epsilon_2$ parameters, to matrix models for $\beta$-ensembles. We find matrix models encoding the instanton part of Nekrasov partition functions, whose measure, to the leading order in $\epsilon_2$ expansion, is given by the Vandermonde determinant to the power $\beta=-\epsilon_1/\epsilon_2$. An additional, trigonometric deformation of the measure arises in five-dimensional theories. Matrix model potentials, to the leading order in $\epsilon_2$ expansion, are the same as in the $\beta=1$ case considered in 0810.4944 [hep-th]. We point out that potentials for massive hypermultiplets include multi-log, Penner-like terms. Inclusion of Chern-Simons terms in five-dimensional theories leads to multi-matrix models. The role of these matrix models in the context of the AGT conjecture is discussed.