How to optimize two variable simultaneously in a function?

5 次查看(过去 30 天)
Following is the function that I want to optimize for two variable theta1_t and theta2_t. There are no constraints so I tried using the fminunc(), but it gives me an error. atk= exp(-theta2_t*k);
btk= (theta1_t/(theta1_t-theta2_t))*(exp(-theta2_t*k)- exp(-theta1_t*k));
func= (atk*y0)+(btk'*u)+gamma where gamma is known.
I have 165 values of theta1_t and theta2_t. I want to choose the optimum one of them. How can I do this? k ranges from 1 to 165.

采纳的回答

Alan Weiss
Alan Weiss 2018-3-22
Are you doing curve fitting? I mean, you have a lot of data and you are trying to find the best parameters of an equation that fits the data? If so, see this example. If not, then I don't understand your question, so please explain a bit more, and maybe show some code or at least the complete MATLAB error message.
Alan Weiss
MATLAB mathematical toolbox documentation

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Solver Outputs and Iterative Display 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by