matlab习题及答案 下载本文

(2)

t=[-pi:0.05:-1.8,-1.799:0.001:-1.2,-1.2:0.05:1.2,1.201:0.001:1.8,1.81:0.05:pi]; >> y=sin(tan(t))-tan(sin(t)); >> plot(t,y)

第六题

>> xx=[-2:0.1:-1.2,-1.1:0.02:-0.9,-0.8:0.1:0.8,0.9:0.02:1.1,1.2:0.1:2]; >> yy=[-1:0.1:-0.2,-0.1:0.02:0.1,0.2:0.1:1];[x,y]=meshgrid(xx,yy); >> z=1./(sqrt((1-x).^2+y.^2))+1./(sqrt((1+x).^2+y.^2)); Warning: Divide by zero. Warning: Divide by zero. >> subplot(224),surf(x,y,z)

>> subplot(221),surf(x,y,z),view(0,90) >> subplot(222),surf(x,y,z),view(90,0) >> subplot(223),surf(x,y,z),view(0,0)

第七题

(1)>> syms x;f=(3^x+9^x)^(1/x);l=limit(f,x,inf) l = 9

(2)>> syms x y;f=x*y/(sqrt(x*y+1)-1);limit(limit(f,x,0),y,0) ans = 2

(3)>> syms x y;f=(1-cos(x^2+y^2))*exp(x^2+y^2)/(x^2+y^2);limit(limit(f,x,0),y,0) ans = 0

第八题

>> syms t;x=log(cos(t));y=cos(t)-t*sin(t);diff(y,t)/diff(x,t) ans =

-(-2*sin(t)-t*cos(t))/sin(t)*cos(t)

>> f=diff(y,t,2)/diff(x,t,2);subs(f,t,sym(pi)/3) ans =

3/8-1/24*pi*3^(1/2) 第九题

>> syms x y t

>> s=int(exp(-t^2),t,0,x*y);

>> x/y*diff(f,x,2)-2*diff(diff(f,x),y)+diff(f,y,2) ans =

2*x^2*y^2*exp(-x^2*y^2)-2*exp(-x^2*y^2)-2*x^3*y*exp(-x^2*y^2)

第十题 (1)

>> syms k n;symsum(1/((2*k)^2-1),k,1,inf) ans = 1/2

>> limit(symsum(1/((2*k)^2-1),k,1,n),n,inf) ans = 1/2 (2)

>> limit(n*symsum(1/(n^2+k*pi),k,1,n),n,inf) ans = 1

第十一题 (1)

>> syms a t;x=a*(cos(t)+t*sin(t));y=a*(sin(t)-t*cos(t)); >> f=x^2+y^2;I=int(f*sqrt(diff(x,t)^2+diff(y,t)^2),t,0,2*pi) I =

2*a^2*pi^2*(a^2)^(1/2)+4*a^2*pi^4*(a^2)^(1/2)

(2)

>> syms x y a b c t;x=c*cos(t)/a;y=c*sin(t)/b; >> P=y*x^3+exp(y);Q=x*y^3+x*exp(y)-2*y; >> ds=[diff(x,t);diff(y,t)];I=int([P Q]*ds,t,0,pi) I =

-2/15*c*(-2*c^4+15*b^4)/b^4/a 第十二题

>> syms a b c d e;A=vander([a b c d e]) A =

[ a^4, a^3, a^2, a, 1] [ b^4, b^3, b^2, b, 1] [ c^4, c^3, c^2, c, 1] [ d^4, d^3, d^2, d, 1] [ e^4, e^3, e^2, e, 1]

>> det(A),simple(ans) ans =

a^4*b^3*c^2*d-a^4*b^3*c^2*e-a^4*b^3*d^2*c+a^4*b^3*d^2*e+a^4*b^3*e^2*c-a^4*b^3*e^2*d-a^4*c^3*b^2*d+a^4*c^3*b^2*e+a^4*c^3*d^2*b-a^4*c^3*d^2*e-a^4*c^3*e^2*b+a^4*c^3*e^2*d+a^4*d^3*b^2*c-a^4*d^3*b^2*e-a^4*d^3*c^2*b+a^4*d^3*c^2*e+a^4*d^3*e^2*b-a^4*d^3*e^2*c-a^4*e^3*b^2*c+a^4*e^3*b^2*d+a^4*e^3*c^2*b-a^4*e^3*c^2*d-a^4*e^3*d^2*b+a^4*e^3*d^2*c-b^4*a^3*c^2*d+b^4*a^3*c^2*e+b^4*a^3*d^2*c-b^4*a^3*d^2*e-b^4*a^3*e^2*c+b^4*a^3*e^2*d+b^4*c^3*a^2*d-b^4*c^3*a^2*e-b^4*c^3*d^2*a+b^4*c^3*d^2*e+b^4*c^3*e^2*a-b^4*c^3*e^2*d-b^4*d^3*a^2*c+b^4*d^3*a^2*e+b^4*d^3*c^2*a-b^4*d^3*c^2*e-b^4*d^3*e^2*a+b^4*d^3*e^2*c+b^4*e^3*a^2*c-b^4*e^3*a^2*d-b^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