📄 coefficient_matrix.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 + -