function y = objfun(x)
sim('modelprototype.slx');
y = Y(1);
end
它在simulink嵌入式func块中。
在寻求帮助之前,我将解释自己的工作和想要的工作;
您可以从下面的链接中找到信息;-https://www.mathworks.com/help/optim/ug/output-functions.html
您可以找到代码和文件-https://github.com/saibermehmet/MATLAB.git
当它是simulink中的嵌入式功能块而不是普通函数m文件时,我再次表示我想优化obj函数。
我知道您已经发布此问题已经很长时间了,但是非常感谢您告诉我解决方案。
提前感谢