数学实验matlab版答案.docx

上传人:b****5 文档编号:14640604 上传时间:2023-06-25 格式:DOCX 页数:14 大小:16.96KB
下载 相关 举报
数学实验matlab版答案.docx_第1页
第1页 / 共14页
数学实验matlab版答案.docx_第2页
第2页 / 共14页
数学实验matlab版答案.docx_第3页
第3页 / 共14页
数学实验matlab版答案.docx_第4页
第4页 / 共14页
数学实验matlab版答案.docx_第5页
第5页 / 共14页
数学实验matlab版答案.docx_第6页
第6页 / 共14页
数学实验matlab版答案.docx_第7页
第7页 / 共14页
数学实验matlab版答案.docx_第8页
第8页 / 共14页
数学实验matlab版答案.docx_第9页
第9页 / 共14页
数学实验matlab版答案.docx_第10页
第10页 / 共14页
数学实验matlab版答案.docx_第11页
第11页 / 共14页
数学实验matlab版答案.docx_第12页
第12页 / 共14页
数学实验matlab版答案.docx_第13页
第13页 / 共14页
数学实验matlab版答案.docx_第14页
第14页 / 共14页
亲,该文档总共14页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

数学实验matlab版答案.docx

《数学实验matlab版答案.docx》由会员分享,可在线阅读,更多相关《数学实验matlab版答案.docx(14页珍藏版)》请在冰点文库上搜索。

数学实验matlab版答案.docx

数学实验matlab版答案

数学实验matlab版答案

【篇一:

matlab数学实验习题全部答案(胡良剑)】

ge20,ex1

(5)等于[exp

(1),exp

(2);exp(3),exp(4)]

(7)3=1*3,8=2*4

(8)a为各列最小值,b为最小值所在的行号

(10)1=4,false,2=3,false,3=2,ture,4=1,ture

(11)答案表明:

编址第2元素满足不等式(30=20)和编址第4元素满足不等式(40=10)

(12)答案表明:

编址第2行第1列元素满足不等式(30=20)和编址第2行第2列元素满足不等式(40=10)

%page20,ex2

(1)a,b,c的值尽管都是1,但数据类型分别为数值,字符,逻辑,注意a与c相等,但他们不等于b

(2)double(fun)输出的分别是字符a,b,s,(,x,)的ascii码

%page20,ex3r=2;p=0.5;n=12;

t=log(r)/n/log(1+0.01*p)

t=

11.5813

%page20,ex4

x=-2:

0.05:

2;f=x.^4-2.^x;

[fmin,min_index]=min(f)

fmin=

-1.3907%最小值

min_index=

54%最小值点编址

x(min_index)

ans=

0.6500%最小值点

[f1,x1_index]=min(abs(f))%求近似根--绝对值最小的点

f1=

0.0328

x1_index=

24

x(x1_index)

ans=

-0.8500

x(x1_index)=[];f=x.^4-2.^x;%删去绝对值最小的点以求函数绝对值次小的点[f2,x2_index]=min(abs(f))%求另一近似根--函数绝对值次小的点

f2=

0.0630

x2_index=

65

1

x(x2_index)

ans=1.2500

%page20,ex5

z=magic(10)

z=

929918156774515840

9880714167355576441

4818820225456637047

8587192136062697128

869325296168755234

17247683904249263365

2358289914830323966

7961395972931384572

10129496783537444653

111810077843643502759

sum(z)

ans=

505505505505505505505505505505sum(diag(z))

ans=

505

z(:

2)/sqrt(3)

ans=

57.1577

46.1880

46.7654

50.2295

53.6936

13.8564

2.8868

3.4641

6.9282

10.3923

z(8,:

)=z(8,:

)+z(3,:

z=

929918156774515840

9880714167355576441

4818820225456637047

8587192136062697128

869325296168755234

17247683904249263365

2358289914830323966

2

83871011151198387101115119

10129496783537444653

111810077843643502759

3

%page40ex1

先在编辑器窗口写下列m函数,保存为eg2_1.mfunction[xbar,s]=ex2_1(x)

n=length(x);

xbar=sum(x)/n;

s=sqrt((sum(x.^2)-n*xbar^2)/(n-1));

例如

x=[81706551766690876177];

[xbar,s]=ex2_1(x)

xbar=

72.4000

s=12.1124

%page40ex2

s=log

(1);n=0;

whiles=100

n=n+1;

s=s+log(1+n);

end

m=n计算结果m=37

%page40ex3

clear;

f

(1)=1;f

(2)=1;k=2;x=0;

e=1e-8;a=(1+sqrt(5))/2;

whileabs(x-a)e

k=k+1;f(k)=f(k-1)+f(k-2);x=f(k)/f(k-1);end

a,x,k

计算至k=21可满足精度

%page40ex4

clear;tic;s=0;

fori=1:

1000000

s=s+sqrt(3)/2^i;

end

s,toc

tic;s=0;i=1;

whilei=1000000

s=s+sqrt(3)/2^i;i=i+1;

4

end

s,toc

tic;s=0;

i=1:

1000000;

s=sqrt(3)*sum(1./2.^i);s,toc

%page40ex5

t=0:

24;

c=[15141414141516182022232528...313231292725242220181716];plot(t,c)

%page40ex6

%

(1)

x=-2:

0.1:

2;y=x.^2.*sin(x.^2-x-2);plot(x,y)y=inline(x^2*sin(x^2-x-2));fplot(y,[-22])%

(2)参数方法

t=linspace(0,2*pi,100);

x=2*cos(t);y=3*sin(t);plot(x,y)

%(3)

x=-3:

0.1:

3;y=x;

[x,y]=meshgrid(x,y);

z=x.^2+y.^2;

surf(x,y,z)

%(4)

x=-3:

0.1:

3;y=-3:

0.1:

13;

[x,y]=meshgrid(x,y);

z=x.^4+3*x.^2+y.^2-2*x-2*y-2*x.^2.*y+6;surf(x,y,z)

%(5)

t=0:

0.01:

2*pi;

x=sin(t);y=cos(t);z=cos(2*t);

plot3(x,y,z)

%(6)

theta=linspace(0,2*pi,50);fai=linspace(0,pi/2,20);

[theta,fai]=meshgrid(theta,fai);

x=2*sin(fai).*cos(theta);

5

【篇二:

matlab数学实验答案】

>(5)等于[exp

(1),exp

(2);exp(3),exp(4)]

(7)3=1*3,8=2*4

(8)a为各列最小值,b为最小值所在的行号

(10)1=4,false,2=3,false,3=2,ture,4=1,ture

(11)答案表明:

编址第2元素满足不等式(30=20)和编址第4元素满足不等式(40=10)

(12)答案表明:

编址第2行第1列元素满足不等式(30=20)和编址第2行第2列元素满足不等式(40=10)

%page20,ex2

(1)a,b,c的值尽管都是1,但数据类型分别为数值,字符,逻辑,注意a与c相等,他们不等于b

(2)double(fun)输出的分别是字符a,b,s,(,x,)的ascii码

%page20,ex3

r=2;p=0.5;n=12;

t=log(r)/n/log(1+0.01*p)

t=

11.5813

%page20,ex4

x=-2:

0.05:

2;f=x.^4-2.^x;

[fmin,min_index]=min(f)

fmin=

-1.3907%最小值

min_index=

54%最小值点编址

x(min_index)

ans=

0.6500%最小值点

[f1,x1_index]=min(abs(f))%求近似根--绝对值最小的点

f1=

0.0328

x1_index=

24

x(x1_index)

ans=

-0.8500

x(x1_index)=[];f=x.^4-2.^x;%删去绝对值最小的点以求函数绝对值次小的点[f2,x2_index]=min(abs(f))%求另一近似根--函数绝对值次小的点

f2=

0.0630

x2_index=

65但

x(x2_index)

ans=

1.2500

%page20,ex5

z=magic(10)

z=

929918156774515840

9880714167355576441

4818820225456637047

8587192136062697128

869325296168755234

17247683904249263365

2358289914830323966

7961395972931384572

10129496783537444653

111810077843643502759

sum(z)

ans=

505505505505505505505505505505sum(diag(z))

ans=

505

z(:

2)/sqrt(3)

ans=

57.1577

46.1880

46.7654

50.2295

53.6936

13.8564

2.8868

3.4641

6.9282

10.3923

z(8,:

)=z(8,:

)+z(3,:

z=

929918156774515840

9880714167355576441

4818820225456637047

8587192136062697128

869325296168755234

17247683904249263365

2358289914830323966

83871011151198387101115119

10129496783537444653

111810077843643502759

%page40ex1

先在编辑器窗口写下列m函数,保存为eg2_1.mfunction[xbar,s]=ex2_1(x)

n=length(x);

xbar=sum(x)/n;

;

例如

x=[81706551766690876177];

[xbar,s]=ex2_1(x)

xbar=

72.4000

s=

12.1124

%page40ex2

s=log

(1);n=0;

whiles=100

n=n+1;

s=s+log(1+n);

end

m=n

计算结果m=37

%page40ex3

clear;

f

(1)=1;f

(2)=1;k=2;x=0;

e=1e-8;a=(1+sqrt(5))/2;

whileabs(x-a)e

k=k+1;f(k)=f(k-1)+f(k-2);x=f(k)/f(k-1);end

a,x,k

计算至k=21可满足精度

%page40ex4

clear;tic;s=0;

fori=1:

1000000

s=s+sqrt(3)/2^i;

end

s,toc

tic;s=0;i=1;

whilei=1000000

s=s+sqrt(3)/2^i;i=i+1;

end

s,toc

tic;s=0;

i=1:

1000000;

s=sqrt(3)*sum(1./2.^i);

s,toc

%page40ex5

t=0:

24;

c=[15141414141516182022232528...313231292725242220181716];plot(t,c)

%page40ex6

%

(1)

x=-2:

0.1:

2;y=x.^2.*sin(x.^2-x-2);plot(x,y)y=inline(x^2*sin(x^2-x-2));fplot(y,[-22])%

(2)参数方法

t=linspace(0,2*pi,100);

x=2*cos(t);y=3*sin(t);plot(x,y)

%(3)

x=-3:

0.1:

3;y=x;

[x,y]=meshgrid(x,y);

z=x.^2+y.^2;

surf(x,y,z)

%(4)

x=-3:

0.1:

3;y=-3:

0.1:

13;

[x,y]=meshgrid(x,y);

z=x.^4+3*x.^2+y.^2-2*x-2*y-2*x.^2.*y+6;surf(x,y,z)

%(5)

t=0:

0.01:

2*pi;

x=sin(t);y=cos(t);z=cos(2*t);

plot3(x,y,z)

%(6)

theta=linspace(0,2*pi,50);fai=linspace(0,pi/2,20);

[theta,fai]=meshgrid(theta,fai);

x=2*sin(fai).*cos(theta);

【篇三:

matlab数学实验报告】

与光照——

浅析matlab中花瓶图片的做法

matlab程序设计教程期中考试作业

班级:

数学系11级a班

姓名:

王佳荣

姓名:

20111611104

数学实验报告

实验序号:

日期:

2014年05月05日Whenyouareoldandgreyandfullofsleep,

Andnoddingbythefire,takedownthisbook,

Andslowlyread,anddreamofthesoftlook

Youreyeshadonce,andoftheirshadowsdeep;

Howmanylovedyourmomentsofgladgrace,

Andlovedyourbeautywithlovefalseortrue,

Butonemanlovedthepilgrimsoulinyou,

Andlovedthesorrowsofyourchangingface;

Andbendingdownbesidetheglowingbars,

Murmur,alittlesadly,howlovefled

Andpaceduponthemountainsoverhead

Andhidhisfaceamidacrowdofstars.

Thefurthestdistanceintheworld

Isnotbetweenlifeanddeath

ButwhenIstandinfrontofyou

Yetyoudon'tknowthat

Iloveyou.

Thefurthestdistanceintheworld

IsnotwhenIstandinfrontofyou

Yetyoucan'tseemylove

Butwhenundoubtedlyknowingthelovefromboth

Yetcannotbetogether.

Thefurthestdistanceintheworld

Isnotbeingapartwhilebeinginlove

ButwhenIplainlycannotresisttheyearning

Yetpretendingyouhaveneverbeeninmyheart.

Thefurthestdistanceintheworld

Isnotstrugglingagainstthetides

Butusingone'sindifferentheart

Todiganuncrossableriver

Fortheonewholovesyou.

 

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > IT计算机 > 电脑基础知识

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2