ex2.m

来自「linear equation routines in matlab」· M 代码 · 共 26 行

M
26
字号
function varargout = ex2(x)%% %%  [F]     = ex2(x)  returns the function value in F%  [F,Jac] = ex2(x)  returns the function value in F and %                    the Jacobian in Jac%%  Matthias Heinkenschloss%  Department of Computational and Applied Mathematics%  Rice University%  March 9, 2004%% return the function valuevarargout{1} = [ 3*x(1)-cos(x(2)*x(3))-0.5;                 x(1)^2-81*(x(2)+0.1)^2+sin(x(3))+1.06;                 exp(-x(1)*x(2))+20*x(3)+(10*pi-3)/3];if( nargout > 1 )  % return the Jacobian as the second argument  varargout{2} = [3                      x(3)*sin(x(2)*x(3))    x(2)*sin(x(2)*x(3));                  2*x(1)                 -162*(x(2)+0.1)        cos(x(3));                  -x(2)*exp(-x(1)*x(2))  -x(1)*exp(-x(1)*x(2))  20      ];end

⌨️ 快捷键说明

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