clopt.m

来自「Advanced Engineering Mathematics using M」· M 代码 · 共 14 行

M
14
字号
% CLOPT.M Find the minimum of a function input as 'fn(x(1),x(2))'%  Input function and initial guess.clearfn=input('Function to minimize as a string f(x(1),x(2))=')%% Input the limits for minimizationxguess=input('Input the starting vector [x(1) x(2)]= ')%xmin=fmins(fn,xguess)	% Find minimum% Display minimum value of functionx(1)=xmin(1);x(2)=xmin(2);zmin=eval(fn) 

⌨️ 快捷键说明

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