①
x1=roots([1,2,1,1])
x2=solve('x^3+2*x^2+x+1=0','x')
vpa(x2)
②
A=randn(10)
B=(A+A')/2
[v,d]=eig(B) % v的列向量就是特征向量,d的对角线值就是特征值
③ 需要将下列语句存入m文件,再用y=myfun(x)调用
function y=myfun(x)
% y=myfun(x)
% y=0.5.*exp(x/3)-x.^2.*sin(x)
y=0.5.*exp(x/3)-x.^2.*sin(x);
④
theta=linspace(0,2*pi,100);
x=5*cos(theta);y=3*sin(theta);
plot(x,y,'bx-');grid on;
title('椭圆 (x/a)^2+(y\b)^2=1');
xlabel('x=5*cos(theta)');ylabel('y=3*sin(theta)');
⑤
x=linspace(-2,2,21);
y=linspace(-1,1,21);
[x,y]=meshgrid(x,y);
z=x.*exp(-x.^2-y.^2);
surf(x,y,z)
分都木有,还好意思叫人帮你做。
这些题都会做,但是太多,你能不能每次一个问题,好回答,再说了,内容太多,也写不下。
谁让你平时不看,哎,学生就该有学生的样,有时间提问就有时间学
matlab是个好东西,好好学不会没用的