%% Evaluate Function with Function Name as Character Vector
% Round the value of pi to the nearest integer using the name of the function.

fun = 'round';
x1 = pi;
y = feval(fun,x1)

%
% Round the value of pi to two digits to the right of the decimal point.

x2 = 2;
y = feval(fun,x1,x2)

% Copyright 2012 The MathWorks, Inc.