froth.m

来自「这次上传的绝对是好东西」· M 代码 · 共 26 行

M
26
字号
% Freudenstein and Roth function % ------------------------------ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  % function [fvec,J]=froth(n,m,x,option)     % Problem no. 2% Dimensions -> n=2, m=2                           % Standard starting point -> x=(0.5,-2)            % Minima -> f=0 at (5,4)                           %           f=48.9842... at (11.41...,-0.8968...)  %                                                  % Revised on 10/22/94 by Madhu Lamba               %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%function [fvec,J] = froth(n,m,x,option)if (option==1 | option==3)        fvec = [ -13+x(1)+((5-x(2))*x(2)-2)*x(2)                 -29+x(1)+((x(2)+1)*x(2)-14)*x(2) ]; end;        if (option==2 | option==3)        J    = [ 1       10*x(2)-3*x(2)^2-2                 1       3*x(2)^2+2*x(2)-14  ] ;        end;%

⌨️ 快捷键说明

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