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

📄 gradient.m

📁 压缩包里包含了无约束优化问题常用的几种求解方法的源程序:变量轮换法(variable_rotation.m)、最速下降法(steepest_descent.m)、修正牛顿法(modified_newt
💻 M
字号:
function G=gradient(str,x)
%  File name:gradient.m      
%  Author:Yan Anxin
%  ID number:081810
%  Date:finished on 2008.11.16
%  Description:  
%       Here defines a function,to get the gradient of the given point    
%       In the syntax G=gradient(str,x),
%       str----input,means the expression of given function
%       x----input,means the given point
%       G=gradient(str,x) returns G, i.e. the gradient of the given point        
             
syms x1 x2
delta=[diff(str,x1);diff(str,x2)];
G=subs(delta,[x1 x2],[x(1) x(2)]);

⌨️ 快捷键说明

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