Nonperturbative effects and nonperturbative definitions in matrix models and topological strings