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.
0 个评论
采纳的回答
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 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!