# [MATLAB], 41 bytes

<!-- language-all: lang-matlab -->

    function x=g(f,x);while f(x)-x;x=f(x);end

[Try it online!][TIO-jay9sznn]

[MATLAB]: https://matlab.mathworks.com/
[TIO-jay9sznn]: https://tio.run/##y08uSSxL/f8/rTQvuSQzP0@hwjZdI02nQtO6PCMzJ1UhTaNCU7fCusIWxLBOzUv5D8TWKZnFBRrpGg5AMSPdCh1DTU3r/wA "Octave – Try It Online"