南邮 数学实验参考答案(选题版)

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

syms x y;

>> a=int(int(exp(x^2+y^2),x,0,1),y,0,1) a =

(pi*erfi(1)^2)/4

1.7、

n=20;

for i=1:(n-2)

a(1)=1;a(2)=1;

a(i+2)=a(i+1)+a(i);

end

a'

ans =

1

1

2

3

5

8

13

21

34

55

89

144

233

377

610

987

1597

2584

4181

6765

1.8、

>> A=[-2,1,1;0,2,0;-4,1,303/1000]; >> inv(A)

0.0893 0.1027 -0.2946

0 0.5000 0

1.1786 -0.2946 -0.5893

>> eig(A)

ans =

-0.8485 + 1.6353i

-0.8485 - 1.6353i

2.0000

>> [p,D]=eig(A)

p =

0.2575 - 0.3657i 0.2575 + 0.3657i 0.2425

0 0 0.9701

0.8944 0.8944 0.0000

D =

-0.8485 + 1.6353i 0 0

0 -0.8485 - 1.6353i 0

0 0 2.0000 >> det(A)

ans =

6.7880

>> A^6

ans =

45.0194 4.7452 -6.3718

0 64.0000 0

25.4870 -6.3718 30.3452

>> A.^6

ans =

1.0e+003 *

0.0640 0.0010 0.0010

0 0.0640 0

4.0960 0.0010 0.0000 1.9、

M文件定义如下:

function y=f(x)

if x>=0&&x<=1/2

y=2*x;

else if x>1/2&&x<=1

y=2-2*x;

end

end

命令窗口执行:

fplot(@f,[0,1])

1.10、

t=-8:0.1:8;

x=cos(t);

y=sin(t);

z=t;

plot3(x,y,z,'r');hold on

x1=2*cos(t);

y1=2*sin(t);

z1=t;

plot3(x1,y1,z1)

grid on

1.11、

>> A=[4 -2 2;-3 0 5;1 5*303 3];

>> B=[1 3 4;-2 0 -3;2 -1 -1];

>> det(A)

ans =

-39418

>> 2*A-B

ans =

7 -7 0

-4 0 13

0 3031 7

>> A*B

ans =

12 10 20

7 -14 -17

-3023 0 -4544

>> A.*B

ans =

4 -6 8

6 0 -15

2 -1515 -3

>> A*B^-1

ans =

-0.4211 -1.4737 0.7368

-1.0000 -2.0000 -3.0000

637.7368 716.5789 398.2105

>> A^-1*B

ans =

0.3467 0.5763 0.9995

0.0015 -0.0017 -0.0013

-0.1920 0.3458 -0.0003

>> A^2

ans =

24 3022 4

-7 7581 9 -4538 4543 7586

>> A'

ans =

4 -3 1

-2 0 1515

2 5 3

1.12、

syms x;

fplot('(1/(sqrt(2*pi)*514/600))*exp(-((x)^2)/2)',[-3,3],'r') hold on

fplot('(1/(sqrt(2*pi)*514/600))*exp(-((x-1)^2)/2)',[-3,3],'b') hold on

fplot('(1/(sqrt(2*pi)*514/600))*exp(-((x+1)^2)/2)',[-3,3],'g') hold off

legend('u为0','u为-1','u为1')

syms x;

fplot('(1/(sqrt(2*pi)*1))*exp(-((x)^2)/2)',[-3,3],'r')

hold on

fplot('(1/(sqrt(2*pi)*2))*exp(-((x)^2)/2)',[-3,3],'b')

hold on

fplot('(1/(sqrt(2*pi)*4))*exp(-((x)^2)/2)',[-3,3],'--')

hold on

fplot('(1/(sqrt(2*pi)*5.14))*exp(-((x)^2)/2)',[-3,3],'g')

hold off

相关文档
最新文档