  We study the behaviour of the inverse participation ratio and the
localization transition in infinitely large random matrices through the cavity
method. Results are shown for two ensembles of random matrices: Laplacian
matrices on sparse random graphs and fully-connected L\'evy matrices. We derive
a critical line separating localized from extended states in the case of L\'evy
matrices. Comparison between theoretical results and diagonalization of finite
random matrices is shown.
