The function you are trying to find the zero of, must return a scalar. Your formula involves surr.h which is a vector, so your function is returning a vector.
Note that fzero which you used has this restriction, but fsolve does not have this restriction.
1 Comment
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/501746-errors-using-function-and-fsolve#comment_789449
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/501746-errors-using-function-and-fsolve#comment_789449
Sign in to comment.