开发者

Declare nonlinear constraint as anonymous function

How can I declare a nonlinear constraint in MATLAB as a开发者_如何学运维n anonymous function. I don't have any inequality constrained, only one equality.


What you need to do is to create an anonymous functions that outputs two arguments. You can do that as follows:

@(x) deal(x^2, 0 )

is what you want. The inequality constraint is the first argument. If you want to have both then equality and inequality constraints it is just.

@(x) deal(x^2, x+1)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜