fminbnd supplies anonymous function with a vector rather than a scalar
2 views (last 30 days)
Show older comments
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
4 Comments
Laura Proctor
on 22 Jun 2011
I just tried the same syntax for FMINBND as above and the value for P was always a scalar. Make sure that you are calling the correct function:
which -all fminbnd
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Optimization in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!