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
-
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
Please sign in to leave a comment.
Comments
1 comment