Yuan weakens in warning to investors