第二章
1 求下列表达式的值。
(1)
w=sqrt(2)*(1+0.34245*10^(-6))
(2)
a=3.5;
b=5;
c=-9.8;
x=(2*pi*a+(b+c)/(pi+a*b*c)-exp(2))/tan(b+c)+a
(3)
a=3.32;
b=-7.9;
y=2*pi*a^(2)*[(1-pi/4)*b-(0.8333-pi/4)*a]
(4)
t=[2,1-3*i;5,-0.65];
z=1/2*exp(2*t)*log(t+sqrt(1+t^(2)))
2 求下列表达式
A=[-1,5,-4;0,7,8;3,61,7];
B=[8,3,-1;2,5,3;-3,2,0];
(1)
A+6*B A^2-B+eye
(2)
A*B A.*B B.*A
(3)
A/B B\A
(4)
[A,B] [A([1,3],:);B^2]
3 根据已知,完成下列操作
(1)
A=[23,10,-0.778,0;41,-45,65,5;32,5,0,32;6,-9.54,54,3.14];
K=find(A>10&A<25);
A(K)
(2)
A=[23,10,-0.778,0;41,-45,65,5;32,5,0,32;6,-9.54,54,3.14];
B=A(1:3,:) C=A(:,1:2) D=A(2:4,3:4) E=B*C
(3)
E
第三章
1 从键盘输入一个3位数,将它反向输出,如输入639,出数936。
f=input('输入一个数:','s');
f(end :-1:1)
2 用if语句
score=input('请输入成绩:');
if score>=90&&score<=100
disp('A');
elseif score>=80&&score<=89
disp('B');
elseif score>=70&&score<=79
disp('C');
elseif score>=60&&score<=69;
disp('D');
elseif score<60&&score>=0;
disp('E');
else
disp('出错');
end
用switch语句
score=input('请输入成绩:');
switch fix(score/10)
case {9,10}
disp('A');
case {8}
disp('B');
case {7}
disp('C');
case {6}
disp('D');
case {0,1,2,3,4,5}
disp('E');
otherwise
disp('出错');
end
第四章
1题
1) X=0:10;
Y=x-x.^3/6;
Plot(x,y)
2) t=0:0.01:2*pi;
x=8.*cos(t);
y=4*sqrt(2).*sin(t);
plot(x,y)
2题
M文件:
t=-pi:pi/10:pi;
y=1./(1+exp(-t));
subplot(2,2,1);bar(t,y,'b');
title('bar(t,y,''b'')');axis([-5,5,-3,3]);
subplot(2,2,2);stairs(t,y,'k');
title('stairs (t,y,''k'')');axis([-5,5,-3,3]);
subplot(2,2,3);stem(t,y,'m');
title('stem (t,y,''m'')');axis([-5,5,-3,3]);
subplot(2,2,4);loglog(t,y,'g');
title('loglog(t,y,''g'')');axis([-5,5,-3,3]);
3题
1) t=0:pi/100:2*pi;
y=5*cos(t)+4;
polar(t,y,'-*')
2) t=-pi/3:pi/100:pi/3;
r=5*sin(t).^2./cos(t);
polar(t,r,'-*')
4题
1)
t=0:pi/100:2*pi;
x=exp(-t/20).*cos(t);
y=exp(-t/20).*sin(t);
z=t;
plot3(x,y,z)
第五章:
1题
A=randn(10,5)
1) X=mean(A)
Y=std(A,0,1)
2) max(max(A))
min(min(A))
3) B=sum(A,2)
sum(B)
4) sort(A);
sort(A,2,'descend')
2题
1) t=0:15:90;
x1=[0,0.2588,0.5000,0.7071,0.8660,0.9659,1.0000];
a1=0:1:90;
y1=interp1(t,x1,a1,'spline')
x2=[0,0.2679,0.5774,1.0000,1.7320,3.7320,NaN];
a2=0:1:75;
y2= interp1(t,x2,a2,'spline')
p1=polyfit(t,x1,5);
z1=polyval(p1,a1)
p2=polyfit(t,x2,5);
z2=polyval(p2,a2)
4题
P=[2,-3,5,13];
Q=[1,5,8];
p=polyder(P)
p1=polyder(P,Q)
[p,q]= polyder(P,Q)
5题
P1=[1,2,4,0,5];
P2=[1,0];
P3=[1,2,3];
1) P4=conv(P2,P3)
P4=[0,1,2,3,0];
P=P1+P4
2) x=roots(P)
3) A=[-1,1.2,-1.4;0.75,2,3.5;0,5,2.5];
Y=polyval(P,A)
4) Z=polyvalm(P,A)
第8章
1.分解因式. (2)factor(sym(‘5135’))
(1)syms A x y;
A=x^4-y^4;
factor(A)
2.求函数的极限
(1)syms x; (2)syms x;
limit((x-2)/(x^2-4),x,2) f=(sqrt(pi)-sqrt(acos(x)))/sqrt(x+1);
limit(f,x,-1,'right')
3.求函数的符号导数。
(1)syms x y (2)sym x;
f=sin(1/x); f=(1-cos(2*x))/x;
diff(f) diff(f,x,2) diff(f) diff(f,x,2)
4.求积分
(1)x=sym(‘x’) (2)sym(‘y’)
f=sqrt(exp(x)+1) f=x/(x+y)
int(f) int(f)
(3) (4)
f=exp(x).*(1+exp(x))^2; f=x .*log(x)
int(f,0,log(2)) int(f,1,exp(1))
5.求下列级数之和
syms n;
s=symsum((-1)^(n+1)/n,1,inf)
x=sym(‘x');
syms n;
s=symsum(x^(2*n-1)/(2*n-1),x,inf)
6.求函数在x=x.处的泰勒展开式
(1)syms x (2) syms x
f1= (exp(x)+exp(-x))/2 f1=sqrt(x^3-2*x+1)
taylor(f1,x,5) taylor(f1,x,6)
7.求非线性方程的符号解
(1)syms x a y
X=slove(‘x^3+a*x+1’,’x’)
1、尊老爱幼是每一个人都应该去做的,让我们大家要从现在做起,从自己做起,从身边的每一件小事做起,做一个尊老爱幼的模范;积极、勇敢地接过先辈们尊老爱幼的接力棒,把祖祖辈辈这一光荣传统,一代一代传下去……在这天高云淡、秋风飒爽的季节,让我们共同祝愿天下所有的老人都能幸福、安康,让我们共同祝愿天下所有的少年儿童都能健康、快乐!谢谢大家
本文来源:https://www.2haoxitong.net/k/doc/15444ca3cf2f0066f5335a8102d276a200296090.html
文档为doc格式