matlab解决高等数学和线性代数的部分问题
程序员文章站
2022-06-21 10:37:40
...
matlab求解高等数学和线性代数的部分问题
高等数学和线性代数是几乎所有理工科学生的必修课,本文通过matlab求解高等数学和线性代数上的问题。
以下为部分程序:
%% 向量的线性相关性
%求矩阵A的一个极大线性无关组
clc
clear
close all
format rat
A=[1,-2,-1,0,2;
-2,4,2,6,-6;
2,-1,0,2,3;
3,3,3,3,4];
B=rref(A);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%验证a1,a2,a3是R3的一个基,并把b1,b2用这个基线性表示
clc
clear
close all
format rat
A=[2,2,-1;
2,-1,2;
-1,2,2];
B=[1,4;
0,3;
-4,2];
C=rref([A,B]);
运行结果:
%% 2)求定积分的数值解
%非连续函数,inf类型
clc
clear
close all
% syms x
% f=1/(x*(x^2-3*x+2)^(2/3));
% I=int(f,x,2,inf);
%对于以上求无穷大的问题用下面的方法
%将无穷大问题进行转化
%通过换元x=1/t得到以下:
Hlimit=1/2;
Llimit=eps;
f1=@(t)(t-3*t.^2+2*t.^3).^(-1/3);
I=quadl(f1,Llimit,Hlimit);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%ff()do D={(x,y)|x^2+y^2<=x}类型
clc
clear
close all
xmax=1;
xmin=0;
ymax=0.5;
ymin=-0.5;
f2=@(x,y)sqrt(1-x.^2-y.^2).*(x.^2+y.^2<=x);
I=dblquad(f2,xmin,xmax,ymin,ymax);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%fff()dv,O={(x,y,z)|0<=z<=sqrt(1-x^2-y^2)}类型
clc
clear
close all
f3=@(x,y,z)z.^2+log(x.^2+y.^2+z.^2+1)./(x.^2+y.^2+z.^2+1).*(z>=0&z<=sqrt(1-x.^2-y.^2));
xmax=1;
xmin=-1;
ymax=1;
ymin=-1;
zmax=1;
zmin=0;
I=triplequad(f3,xmin,xmax,ymin,ymax,zmin,zmax);
运行结果:
有需要的同学可以添加微信进行购买:shuxuexiaobaibututou(记得备注哦)
上一篇: 移动端页面自适应大小
下一篇: 获得当前时间的总毫秒数