convert math expression to matlab code

9 ビュー (過去 30 日間)
Bourne Zhang
Bourne Zhang 2023 年 5 月 20 日
回答済み: Dongyue 2023 年 5 月 23 日
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
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
Dongyue 2023 年 5 月 23 日
You can try MATLAB Optimization Toolbox
Please go through the following link for more information:

カテゴリ

Help Center および File ExchangeParticle Swarm についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by