南邮数学实验答案(26 页)Good is good, but better carries it.精益求精,善益求善。第一次练习题1、求的所有根。>>x=-5:0.01:5;y=exp(x)-3*x.^2;plot(x,y);grid on-5-4-3-2-1012345-80-60-40-20020406080>> fsolve('exp(x)-3*x.^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.4590>> fsolve('exp(x)-3*x.^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.9100>> fsolve('exp(x)-3*x.^2',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.73312、求下列方程的根。1) 2) 3) 1) >> p=[1,0,0,0,5,1];r=roots(p)r = 1.1045 + 1.0598i 1.1045 - 1.0598i -1.0045 + 1.0609i -1.0045 - 1.0609i -0.1999 2) >> x=-10:0.01:10;y=x.*sin(x)-1/2;plot(x,y);grid on-10-8-6-4-20246810-6-4-202468>> fsolve('x.*sin(x)-1/2',-6)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 = -6.3619>> fsolve('x.*sin(x)-1/2',-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 = -2.9726>> fsolve('x.*sin(x)-1/2',2)Eq...