11.求方程2x^5-3x^3+71x^2-9x+13=0的全部跟
>> p=[2,0,-3,71,-9,13];
>> x=roots(p);
12.求解线性方程组2x+3y-z=2
8x+2y+3z=4
45x+3y+9z=23
>> a=[2,3,-1;8,2,3;45,3,9];%建立系数矩阵a
>> b=[2,4,23]%建立列向量b
>> x=inv(a)*b
13.求解积分0->1xln(1+x)
>> quad('x.*log(1+x)',0,1)
14.多项式曲线拟合
>> x=[1,2,3,4,5,6,7,8,9,10];
>> y=[1,2,3,4,5,4.7,5,5.2,6,7.2];
>> p1=polyfit(x,y,1)%一次多项式拟合
>> p3=polyfit(x,y,3)%三次多项式拟合
>> x2=1:0.1:10;
>> y1=polyval(p1,x2);
>> y3=polyval(p3,x2);
>> plot(x,y,'*',x2,y1,':',x2,y3)
15.函数linspace(x1,x2,n)
>> x=linspace(1,2,5)
x =1.0000 1.2500 1.5000 1.7500 2.0000
16.ones(生成全1的矩阵)、zeros(生成全0的矩阵)
>> ones(3)
>> ones(3,4)
17.函数reshape()
>> a=-4:4
>> reshape(a,3,3)
18.画出y=1/(x+1)的函数曲线,x∈[0,100]
>> x=0:100;
>> y=1./(x+1);
>> plot(x,y);
>> legend('y=1/(x+1)');
19.生成一个信号x=sin(2*pi*t)+sin(4*pi*t)
>> t=[0:199]./100;%采样时间点
>> x=sin(2*pi*t)+sin(4*pi*t);%生成信号
>> plot(t,x);
>> legend('sin(2*pi*t)+sin(4*pi*t)');
20.判断方阵中的元素能否被3整除
>> A=[24,35,13;23,39,47;90,41,80];
>> P=rem(A,3)==0%被3整除,求余