作业帮 > 综合 > 作业

几道MATLAB的题,需要具体代码

来源:学生作业帮 编辑:灵鹊做题网作业帮 分类:综合作业 时间:2024/06/12 23:31:15
几道MATLAB的题,需要具体代码
1求e^x-3*x^2=0的所有根并画图
2求x*sin(x)-1/2=0的至少三个根
3求sinx*cosx-x^2=0的所有根
4求0到1/2的exp(811x^2)定积分
5将sqrt(0.811+x)在x=0展开并且x最高次幂为8
几道MATLAB的题,需要具体代码
1、
f=@(x)exp(x)-3*x.^2;
a1=fsolve(f,1);
a2=fsolve(f,0);
x=-2:0.01:2;
y=f(x);
figure
plot(x,y,x,zeros(1,length(x)))
hold on
plot(a1,0,'r*',a2,0,'r*')
2、
f=@(x)x.*sin(x)-1/2;
a1=fsolve(f,1);
a2=fsolve(f,3);
a3=fsolve(f,5);
x=0:pi/100:3*pi;
y=f(x);
figure
plot(x,y,x,zeros(1,length(x)))
hold on
plot(a1,0,'r*',a2,0,'r*',a3,0,'r*')
3、
f=@(x)sin(x).*cos(x)-x.^2;
a1=fsolve(f,0);
a2=fsolve(f,3);
x=-1:0.001:1;
y=f(x);
figure
plot(x,y,x,zeros(1,length(x)))
hold on
plot(a1,0,'r*',a2,0,'r*')
4、
f=inline('exp(811*x.^2)');
jifen=quad(f,0,1/2);
5、
syms x
f=sqrt(0.811+x);
f8=taylor(f,9)
祝你学习愉快!