MATLAB: How to make the inline function can identify the matab coded function

symbolic

I am using the sybolic toolbox of matlab but find the inline function cant identify the matlab coded function. For example,
if i use
syms x y
FT=@(x, y)min(x, y);
ans=dblquad(FT, -1, 1, -1, 1);
the answer is correct.
but if i use it alternatively as
syms x y
FT=inline(min(x, y));
ans=dblquad(FT, -1, 1, -1, 1);
it is failed.
So how to make the inline function to identify the matlab's own function?
Thanks so much

Best Answer

syms is irrelevant to what you are doing. You should not be using syms.
Your first approach passes a function handle of two arguments as the first argument to dblquad(). dlbquad() will pass the function a vector for the first argument, and a scalar for the second argument. min() is happy to work with that, and will compare each value in x to the scalar in y.
Your second approach tries to evaluate min(x,y) and pass the result to inline(). In your code, because you defined x and y as syms, min(x,y) is going to be a symbolic expression. inline() requires, however, that it be passed a character expression. Correct coding would be to leave out the syms command and use
FT = inline('min(x,y)');
By the way, your first code version, with the function handle FT, could have been coded as simply
ans = dblquad(@min, -1, 1, -1, 1);