Updated matlab interface to dynamic max iterations