MATLAB遗传算法求解多变量函数最大值及迭代可视化
使用MATLAB遗传算法(ga)求解多变量函数的最大值,支持不同变量范围,并确保迭代图显示原始目标函数的正数值。
npx skills add ECNU-ICALK/AutoSkill --skill matlab遗传算法求解多变量函数最大值及迭代可视化 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# 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遗传算法迭代图显示正值 - 求解多变量函数最优解最大值
- Prompt
- Triggers
What does the MATLAB遗传算法求解多变量函数最大值及迭代可视化 skill do?
使用MATLAB遗传算法(ga)求解多变量函数的最大值,支持不同变量范围,并确保迭代图显示原始目标函数的正数值。
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill matlab遗传算法求解多变量函数最大值及迭代可视化 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
