function [Xn]=Ej4(fun,Xn,tol)
syms x
der = diff(fun,x);
error = 1;
tolerancia = tol;
    while error>=tolerancia
         X1 = Xn - (subs(fun,Xn)/subs(der,Xn));
         error = abs((X1-Xn)/X1);
         Xn=X1;
    end
end
Not enough input arguments.

Error in Ej4 (line 4)
der = diff(fun,x);