%#求导
syms x;
y = exp(x)*(sinh(x)-cosh(x));
diff(y,x)
%#泰勒展开
syms x
T1 = taylor(exp(x))
%#积分
syms x;
y = tan(x)^2*sin(x);
int(y,x)
%#定积分
syms x;
y = 2* (4*cos(x)-sin(x))/(6*cos(x)^2+1) * -sin(x) ;
int(y,x,0,2*pi)
%#相等
syms x;simplify(( )-( ))
%#对比图
x = -100:0.01:100;
plot(x, ,x, ,'--')
%#二元图
x = -9:0.01:9;y = -9:0.01:9;[S,T] = meshgrid(x,y);
Z = sqrt(S.^2-T.^2);mesh(S,T,Z);
%#微分方程
dsolve('Dx = 2*x-3*y+3*z+t','Dy = 4*x-5*y+3*z+t','Dz = 4*x-4*y+2*z+t','t')
%#含参微分方程
syms y(x) a
eqn = (y-diff(y,x)==a*x);
dsolve(eqn)
%#微分方程带入
syms x; y = 2*x*exp(x); a = [1 1 -1 -1]; order = [diff(y, x, 3); diff(y, x, 2); diff(y, x, 1); y];
a*order
%#表达式
text('Interpreter','latex','String','$...$','Position',[0,0.5],'FontSize',30);
%#可读直观
syms x
y = 1/(2*x)+exp(-x+1)+sin(tan(x));
LaTex = latex(y)
%#分段函数
y=0:0.0001:4;
v=( 3./(8*sqrt(y)) ).*(y>= 0 & y< 1 )+( 1./(8*sqrt(y)) ).*(y>= 1 & y< 4 );
plot(y,v);
axis([0 5 0 100]);
%#反函数
syms x
f=x*sin(x)
f1=finverse(f,x)
%#特征值和特征向量
A = [; ; ;];
[V,D] = eig(A)
%#迹
trace(A)
%#行列式
det(A)
%#行最简型
A = [; ; ;];
R = rref(A) %用高斯—约当消元法和行主元法求A的行最简行矩阵R
%#矩阵相乘
syms a
A = [1 0 1;0 1 1 ;-1 0 a ;0 a -1];
A'*A
%#分块矩阵
A1 = [1 2; 3 4]; A2 = [5 6; 7 8]; B = blkdiag(A1, A2, zeros(2), eye(2))
%#伴随
B = det(A)*inv(A)
%#不可逆
X = adjoint(A)
%#秩
rank(A);
%#特解
x = A\b % x = A3\[1 0]'
%#基础解系
A = [; ; ;];
B=null(A,'r')
%#特征方程
A = [; ; ;];lambda = ; E = eye();
F = A - lambda*E;
%#正态分布
x = [-3:.1:3];
y = normpdf(x,0,1);
plot(x,y)
%#标准正态分布
pd = makedist('Normal')
p = cdf(pd,x);
%#二项分布
r_scalar = binornd(100,0.2)
%#多项式
syms a l
ss = (l - (a+1))*(l - (a-2))
simplify(ss); %%简化多项式
expand(ss)%#展开
%#因式分解
syms x y;
factor(x^3-y^3)
%#函数化简
f = @(x) 1-exp(-x);
syms x a
simplify(( f(a+1)-f(a) )/f(a)); %%简化多项式
Matlab命令行数学常用代码
最新推荐文章于 2024-08-31 23:34:30 发布