MATLAB: How to transform this handle into a string

handleshomeworkMATLAB

My code is:
function x = find_zero( f,x1,x2 )
%FIND_ZERO Summary of this function goes here
% Detailed explanation goes here
Y=fnzeros(f,[x1,x2]);
end
The question is below:
%

Best Answer

You do not need to "Get rid of the '@' symbol". That symbol creates a function handle. A function handle is much more useful for you than anything you could do mucking about with strings. In fact playing around with string would be an awful way to write this code. With a function handle you can simply call it like you would any other function.
Have a look at this:
>> myfun = @(fun,x) fun(x); % define an anonymous function
>> myfun(@sin,pi/2)
ans = 1
>> myfun(@cos,pi/2)
ans = 0
>> myfun(@(n)n+1,pi/2)
ans = 2.5708
I just supply the function handle (either @sin or @cos, or anything else) to my custom function myfun, and it calls that function and does whatever myfun wants with it.