convert math expression to matlab code
조회 수: 8 (최근 30일)
이전 댓글 표시
Hello Experts and community members,
I am sorry but I am new to Matlab, and would like to know How can I conver the following math expression to matlab code?
and I am lerning the paper of WOA, whale optimization algorithm, so if I would like to add the above to the function, anything I need to pay attention to?
Thank you so much in advance for any input and insights!
댓글 수: 1
John D'Errico
2023년 5월 20일
If you are new to MATLAB, then if someone gives you highly optimized code to do this will be useless. You won't understand it, and it would take a couple of pages of explanation to get you to understand what it does, and you still won't be able to write a similar function yourself the next time. Yes, the objective is a quadratic functional of the vector w, with linear constraints. So you should be able to write this as a call to quadprog. But it sounds as if you are asking how to write this for your own optimizer.
Instead, just learn to write the objective using LOOPS. Loops are simple. And the call to optimize it, if you were using a tool like fmincon will be simple, but any other tool that allows a linear equality constraint and bound constraints would suffice.
답변 (1개)
Dongyue
2023년 5월 23일
You can try MATLAB Optimization Toolbox
Please go through the following link for more information:
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Linear Programming and Mixed-Integer Linear Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!