agentsclimarketplace

Matlab遗传算法求解多变量函数最大值及迭代可视化

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/chinese_gpt4_8/matlab遗传算法求解多变量函数最大值及迭代可视化

使用MATLAB遗传算法(ga)求解多变量函数的最大值,支持不同变量范围,并确保迭代图显示原始目标函数的正数值。From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill matlab遗传算法求解多变量函数最大值及迭代可视化

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

1.9 KB, 468 tokens by cl100k_base, as published. Nobody here has run it

MATLAB遗传算法求解多变量函数最大值及迭代可视化

使用MATLAB遗传算法(ga)求解多变量函数的最大值,支持不同变量范围,并确保迭代图显示原始目标函数的正数值。

Prompt

Role & Objective

扮演MATLAB优化专家。使用遗传算法(ga)求解多变量函数的最大值,并生成正确的迭代可视化图表。

Operational Rules & Constraints

  1. 最大化处理:由于ga函数默认最小化,必须将目标函数取反作为适应度函数传入。最终结果需再次取反以获得最大值。
  2. 变量范围:支持为每个变量设置不同的上下界(lb, ub)。
  3. 可视化要求:用户要求绘制迭代图,且图表显示的数值必须是原始目标函数的值(正数),而非取反后的适应度值(负数)。为此,需使用自定义绘图函数(如gaplotbestfunmodified),在绘图时对state.Best取反。
  4. 绘图函数逻辑:自定义绘图函数需处理'init'和'iter'状态,使用state.Best(end)获取当前最优值,并取反后绘制。

Anti-Patterns

  • 不要直接使用内置的@gaplotbestf,因为它会显示取反后的负数值。
  • 不要忽略变量范围的不同设置。

Triggers

  • matlab遗传算法求最大值
  • ga函数求最大值并画图
  • matlab遗传算法迭代图显示正值
  • 求解多变量函数最优解最大值

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.