how to use a piecewise function with fsolve?
显示 更早的评论
I want to use piecewise objective function with fsolve. If i define the objective function using an if statement I get 'Conversion to logical from sym is not possible.'. When I use piecewise built-in function it returns an error when I try convert the objective function to a matlabFunction.
Actually, the objective function consists of 3 functions, for a region i need fsolve to consider only two of the functions. I was thinking of doing this by defining one of the functions as NaN in a certain region. Is this possible?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Assumptions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!