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

📄 coefficient_matrix.m

📁 压缩包里包含了无约束优化问题常用的几种求解方法的源程序:变量轮换法(variable_rotation.m)、最速下降法(steepest_descent.m)、修正牛顿法(modified_newt
💻 M
字号:
function [A,b]=coefficient_matrix(str)
%  File name:coefficient_matrix.m      
%  Author:Yan Anxin
%  ID number:081810
%  Date:finished on 2008.11.15
%  Description:  
%       Here defines a function,to get the coefficient of the given function expression    
%       In the syntax [A,b]=coefficient_matrix(str),
%       str----input,means the expression of given function
%       A=coefficient_matrix(str) returns A, i.e. the coefficient of the quadratic term    
%       [A,b]=coefficient_matrix(str) returns b, i.e. the coefficient of the linear term       
            
syms x1 x2 y
str=subs(str,x1*x2,y);
f=sym(str);
A=double([maple('coeff',f,x1,2),maple('coeff',f,y,1)/2;
   maple('coeff',f,y,1)/2,maple('coeff',f,x2,2)]);
b=double([maple('coeff',f,x1,1);maple('coeff',f,x2,1)]);

⌨️ 快捷键说明

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