⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wbobjfun.m

📁 This demo shows how to use MATLAB, Optimization Toolbox, and Genetic Algorithm and Direct Search Too
💻 M
字号:
function varargout = wbObjFun(x,time,profile)
% Simulate the wishbone model in Simulink and get camber vs. distance
% profile and/or norm of profile
%
% Use:
% F = wbObjFun(x,time,profile) returns norm of profile and sim profile
% [F,P] = wbObjFun(x,time,profile) returns profile in P

if isstruct(x), x = x.x; end

% Run simulation
simopt = simset('SrcWorkspace','Current');
[unused1,unused2,yout]= sim('DoubleWishbone',time,simopt);

% Return norm value]
if isempty(profile)
    varargout{1} = NaN;
else
    varargout{1} = norm(yout(:,1) - profile(:,1)) + norm(yout(:,2) - profile(:,2));
end

if nargout > 1 % return profile if requested
    varargout{2} = yout;
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -