Mode-locking induced by continuous wave driving in a fiber laser