1、数学实验1第一次练习题1 求的所有根。(先画图后求解) fplot(exp(x)-3*x2,0,-5,5); grid on fsolve(exp(x)-3*x2,-1)Equation solved.fsolve completed because the vector of function values is near zeroas measured by the default value of the function tolerance, andthe problem appears regular as measured by the gradient.ans = -0.4590
2、Optimization terminated: first-order optimality is less than options.TolFun.ans = -0.4590fsolve(exp(x)-3*x2,1)Equation solved.fsolve completed because the vector of function values is near zeroas measured by the default value of the function tolerance, andthe problem appears regular as measured by t
3、he gradient.ans = 0.9100 fsolve(exp(x)-3*x2,4)Equation solved.fsolve completed because the vector of function values is near zeroas measured by the default value of the function tolerance, andthe problem appears regular as measured by the gradient.ans = 3.7331求得此方程的三个根2 求下列方程的根。1) p=1,0,0,0,5,1;r=ro
4、ots(p)r = 1.1045 + 1.0598i 1.1045 - 1.0598i -1.0045 + 1.0609i -1.0045 - 1.0609i -0.1999 2) fsolve(x*sin(x)-1/2,-3)Equation solved.fsolve completed because the vector of function values is near zeroas measured by the default value of the function tolerance, andthe problem appears regular as measured
5、by the gradient.ans = -2.9726 fsolve(x*sin(x)-1/2,-1)Equation solved.fsolve completed because the vector of function values is near zeroas measured by the default value of the function tolerance, andthe problem appears regular as measured by the gradient.ans = -0.7408 fsolve(x*sin(x)-1/2,2)Equation
6、solved.fsolve completed because the vector of function values is near zeroas measured by the default value of the function tolerance, andthe problem appears regular as measured by the gradient.ans = 0.7408 3) fsolve (sin(x)*cos(x)-x2,0)Equation solved at initial point.fsolve completed because the ve
7、ctor of function values at the initial pointis near zero as measured by the default value of the function tolerance, andthe problem appears regular as measured by the gradient.ans = 0 fsolve (sin(x)*cos(x)-x2,1)Equation solved.fsolve completed because the vector of function values is near zeroas mea
8、sured by the default value of the function tolerance, andthe problem appears regular as measured by the gradient.ans = 0.70223 求解下列各题: 1) syms xlimit(x-sin(x)/x3) ans = 1/62) syms xy=exp(x)*cos(x);g=diff(y,4)g =-4*exp(x)*cos(x)3) vpa(int(exp(x2),x,0,1/2),17)ans =0.544987104183622204) int(x4/(25+4*x2
9、),x) ans = (125*atan(2*x)/5)/32 - (25*x)/16 + x3/125) taylor(sqrt(1+x),9,x,0)ans =- (429*x8)/32768 + (33*x7)/2048 - (21*x6)/1024 + (7*x5)/256 - (5*x4)/128 + x3/16 - x2/8 + x/2 + 16) diff(exp(sin(1/x),x,3) ans =(cos(1/x)*exp(sin(1/x)/x6 - (6*cos(1/x)*exp(sin(1/x)/x4 + (6*sin(1/x)*exp(sin(1/x)/x5 -(6*
10、cos(1/x)2*exp(sin(1/x)/x5-(cos(1/x)3*exp(sin(1/x)/x6+(3*cos(1/x)*sin(1/x)*exp(sin(1/x)/x6 p=cos(1/x)/x6*exp(sin(1/x)+6*sin(1/x)/x5*exp(sin(1/x)+3*sin(1/x)/x6*cos(1/x)*exp(sin(1/x)-6*cos(1/x)/x4*exp(sin(1/x)-6*cos(1/x)2/x5*exp(sin(1/x)-cos(1/x)3/x6*exp(sin(1/x)p = (cos(1/x)*exp(sin(1/x)/x6- (6*cos(1/
11、x)*exp(sin(1/x)/x4 + (6*sin(1/x)*exp(sin(1/x)/x5 -(6*cos(1/x)2*exp(sin(1/x)/x5-(cos(1/x)3*exp(sin(1/x)/x6+(3*cos(1/x)*sin(1/x)*exp(sin(1/x)/x6 subs(p,x,2)ans = -0.58264 求矩阵 的逆矩阵及特征值和特征向量。 A=-2,1,1;0,2,0;-4,1,3A = -2 1 1 0 2 0 -4 1 3 inv(A)ans = -1.5000 0.5000 0.5000 0 0.5000 0 -2.0000 0.5000 1.0000
12、eig(A)ans = -1 2 2 P,D=eig(A)P = -0.7071 -0.2425 0.3015 0 0 0.9045 -0.7071 -0.9701 0.3015D = -1 0 0 0 2 0 0 0 2 5 已知分别在下列条件下画出的图形:(1)fplot(1/sqrt(2*pi)*exp(-x2/2),1/sqrt(2*pi)*exp(-(x+1)2/2),1/sqrt(2*pi)*exp(-(x-1)2/2),-10,10)(2)fplot(1/sqrt(2*pi)*exp(-x2/2),1/(sqrt(2*pi)*2)*exp(-x2/8),1/(sqrt(2*pi)*4)*exp(-x2/32),-10,10)6 画 下列函数的图形:(1) ezmesh(u*sin(t),u*cos(t),t/4,0,20,0,2)(2) ezmesh(sin(x*y),0,3,0,3)(3)(第6题只要写出程序). ezmesh(sin(t)*(3+cos(u),cos(t)*(3+cos(u),sin(u),0,2*pi,0,2*pi)
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1