How to use function handle in Matlab
AnsweredHi community
Now I tried to use Matlab to solve an integer optimal control problem. The control problem can be formulated as Integer Quadratic Programming so I want to use Gurobi to solve that.
Before getting the objective, I need to solve some ill-conditioned equations, which means "\" is not a good way to solve that. I chose GMRES to solve it. But I found that obj can not be used function handle to code. (Just like using Gurobi in python)
I have noticed I can use Gurobi within MATLAB’s Problem-Based Optimization.
But it still doesn't seem to be a handle. (it seems like a string type? I'm not sure)
Best,
Max
-
Official comment
This post is more than two years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support. -
Hi Max,
Please check out our documentation to learn how to formulate your models in Matlab:
Please note that you cannot use arbitrary function within constraints. You need to formulate a fixed or "static" model.
Cheers,
Matthias0
Post is closed for comments.
Comments
2 comments