MATLAB: Fminbnd supplies anonymous function with a vector rather than a scalar

fminbndOptimization Toolbox

My M-file function Y = MEP_ObjFun(P,B,R,T) requires inputs scalar P and [1 x N] vectors B, R, T and returns a scalar Y.
When I call this anonymously using fminbnd()
Popt = fminbnd(@(y)MEP_ObjFun(y,B,R,T),lb,ub);
and inquire size(P) inside of MEP_ObjFun.m it returns [1 x N].
Why is fminbnd assuming I want to pass a vector rather than a scalar and how do I control this?
Thank you, Grey

Best Answer

Problem: One (or both) of the bounds (lb, ub) is a vector.