矩阵计算习题及答案.docx

上传人:b****6 文档编号:7527186 上传时间:2023-05-11 格式:DOCX 页数:14 大小:167.10KB
下载 相关 举报
矩阵计算习题及答案.docx_第1页
第1页 / 共14页
矩阵计算习题及答案.docx_第2页
第2页 / 共14页
矩阵计算习题及答案.docx_第3页
第3页 / 共14页
矩阵计算习题及答案.docx_第4页
第4页 / 共14页
矩阵计算习题及答案.docx_第5页
第5页 / 共14页
矩阵计算习题及答案.docx_第6页
第6页 / 共14页
矩阵计算习题及答案.docx_第7页
第7页 / 共14页
矩阵计算习题及答案.docx_第8页
第8页 / 共14页
矩阵计算习题及答案.docx_第9页
第9页 / 共14页
矩阵计算习题及答案.docx_第10页
第10页 / 共14页
矩阵计算习题及答案.docx_第11页
第11页 / 共14页
矩阵计算习题及答案.docx_第12页
第12页 / 共14页
矩阵计算习题及答案.docx_第13页
第13页 / 共14页
矩阵计算习题及答案.docx_第14页
第14页 / 共14页
亲,该文档总共14页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

矩阵计算习题及答案.docx

《矩阵计算习题及答案.docx》由会员分享,可在线阅读,更多相关《矩阵计算习题及答案.docx(14页珍藏版)》请在冰点文库上搜索。

矩阵计算习题及答案.docx

矩阵计算习题及答案

矩阵-计算习题及答案

1、选择题

1)下列变量中是合法的。

A.Char_1,i,jB.x*y,a.1C.X\y,

a1234D.end,1bcd

2)下列是合法的常量。

A.3e10B.1e500C.-1.85e-56

D.10-2

3)x=uint8(1.2e10),贝Vx所占的字节是D个。

A.1B.2C.4

D.8

4)已知x=0:

10,则x有B个元素。

A.9B.10C.11

D.12

5)产生对角线元素全为1其余为0的2X3矩阵

的命令是C。

A.Ones(2,3)B.Ones(3,2)C.Eye(2,3)

D.Eye(3,2)

123

6)a=456,贝Va(:

end)是扌指C。

789

A.所有元素B.第一行元素C.第三列元素D.第三行元素

7)a=

"23、

456

J8%

则运行a(:

J)=n命令后

A.a变成行向量

B.a数组成2行2列C.a

 

B.计算a每列

D.a数组增加一

数组成3行2列D.a数组没有元素

fl23)s

8)a=456,则运行命令inean(a)是

J89;

A.计算a的平均值的平均值

C.计算a每行的平均值

列平均值

9)已知x是一个向量,计算ln(x)的命令是

D・lglO(x)

数名是

D.floor

11)已知a=0:

4,b=l:

5,下面的运算表达式出错的是一D。

D.a*b

12)已知a=4,b=‘4'下面说法错误的是

C。

A.变量a比变量b占用的空间大B.变量

a、b可以进行加减乘除运算

C.变量a、b数据类型相同D.变量

b可以用eval计算

13)已知s='显示“hello"',贝Us元素的个数

是A。

A.12B.9C.7

D.18

14)运行字符串函数strncmp('s1','s2',2),则结果为B。

A.1B.0C.true

D.fales

15)命令day(now)是指C。

A.按日期字符串格式提取当前时间B.提

取当前时间

C.提取当前时间的日期D.按

日期字符串格式提取当前日期

16)有一个2行2列的元胞数组c,则c

(2)

是扌旨D。

A.第1行第2列元素内容B.第2行第1列

元素内容

C.第1行第2列元素D.第2行第1列

元素

17)以下运算中哪个运算级别最高B。

A.*B.AC.~D.

/

18)运行命令bitand(20/15)的结果是C

A.

15B.

20

C.4

D

5

19)

使用检测函数

isin

teger

(15)

的结果是

B

A.

1

B.

0

C.true

D.fa

les

20)

计算三个多项式

s1、

s2和

s3的乘积,则算

式为

C。

A.conv(s1,s2,s3)B.s1*s2*s3C.

conv(conv(s1,s2),s3)D.conv(s1*s2*s3)

以下写出MATLAB命令序列,并给出结果

2.复数向量a=2+3i/b=3-4i/计算

a+b,a-b,c=a*b,d=a/b,并计算变量c的实部、虚部、模和相角。

00555

3•用from:

step:

to的方式和linspace函数分别

得到0〜4n步长为0.4n的变量x1,0〜4n分成

10个点的变量x2。

»x1=0:

0.4*pi:

4*pi%bywl

素3,使用单下标方式提取元素8,取出后两行子矩阵块,使用逻辑矩阵提取〔3。

»a=[123;456;789]%bywl—

ans=

a=

123

456

45

78

6

9

789

»a(2:

3.:

%bywl

»日(化3)%bywl

ans=

ans=

45

6

3

78

9

»a(6)%bywl

»a([1,31(1,3])%bywl

ans=

ans=

8

13

79

5•输入a为3X3的魔方阵,b为3X3的单位阵,将他们生成3X6的大矩阵c、6X3的大矩阵d,将d的最后一行提取生成小矩阵e。

沙护帼gic⑶狮训»c=[aib]%byw|

°1°Columns1throuqh5

357

492

6

1

6

1

0

3

5

7

0

1

b=eye(3)%bywl

4

9

2

0

0

u'Column6

100o

010o

0011

>>d=[a;b]%bywl

816

357

492

100

010

001

»d(endT:

)%bywl

ans=

001

123

6•矩阵a=456用flipud、fliplr、rot90、diag、

789

triu和tril进行操作。

并求其转置、秩、逆矩阵、矩阵的行列式值及三次幕。

»

a=reshape('1:

9,3,3);

%bywl

>>flipir(e)

%bywl

>>

a=a'

ans=

a=

32

1

123

65

4

456

96

7

789

»rot90(a)

%bywl

»

a=reshape(1:

9,3;3);

%bywl

AA

a=a'%byv?

l

ans=

a=

36

9

25

9

123

14

7

456

789

»diag(a)

%bywl

»triu(a)

»delta)%bywt

-

66613e-015

R9^3

4S8

57&

684

1062

1305

1548

1655

2034

2412

»3a3%bywl

ans-

460

57&

634

1062

1305

1S48

165&

2034

2412

=

8解线性方程组

2x3x2x32x48

X3x2x46

o

x1x2x38x47

7x13x22x32x45

»A=p-312:

1301:

1-11871-22]%byd

2-312

1301

1-113

71-22

»b=[8,6;7;5J%bywl

3-

3

7

S

>>x=inv(Afb%bywl

x=

2.5353

1.2D33

6.8299

-O.U£5

9•输入字符串变量a为‘hello'将其每个字符后移4个,如‘h'变为’I'然后再逆序存入变量b。

»a=helloF;%bywl

»b=char(fliplr(doubl@(a)+4))%bywl

b=

sppil

10计算函数f(t)10e2tsin(4t),其中t范围为0到20,步长为0.2,g(t)为f(t)大于0的部分,计

算g(t)的值

»t=0:

0.2:

20;%bywl

»f=10*exp(2^t)-sin(4*t)%bywl

1.0e+018*

Columns1through6

 

0,00000,00000.00000,0000

0.0000

owoo

 

Columns7through12

 

0.00000.00000.00000.0000

0.0000

0.0000

Columns13through18

0.00000.00000.0000

Columns19through24

0.00000.00000.00000.00000.00000.0000

 

Columns25through30

0.00000.00000.0000

Columns31through36

0.00000.00000.0000

Columns37through42

0.00000.00000.0000

Columns43through48

0.00000.00000.0000

Columns49through54

0.0000

0.0000

0.0000

0.0000

0.0000

0.0000

0.0000

0.0000

0.0000

0.0000

0.0000

0.0000

 

0.00000.00000.00000.00000.00000.0000

Columns55through60

 

0.00000.00000.0000

Columns61through66

0.00000.00000.0000

Columns67through72

0.00000.00000.0000

Columns73through78

0.00000.00000.0001

Columns79through84

0.0000

0.0000

0.0000

0.0000

0.0000

0.0000

0.0000

0.0000

0.0000

0.0001

0.0002

0.0002

 

0.00040.00050.00080.00120.00180.0026

Columns85through90

0.00390.00580.0087

0.0130

0.0194

0.0289

Columns91through96

0.04310.06430.0959

0.1431

0.2135

0.3186

Columns97through101

0.47520.70901.0577

1.5778

2.3539

»f1=f(f>=0)%bywl

f1=

1.0e+018*

Columns1through6

0.00000.00000.0000

0.0000

0.0000

0.0000

Columns7through12

 

0.00000.00000.0000

Columns13through18

0.00000.00000.0000

Columns19through24

0.00000.00000.0000

Columns25through30

0.00000.00000.0000

Columns31through36

0.0000

0.0000

0.0000

0.0000

0.0000

0.0000

0.0000

0.0000

0.0000

0.0000

0.0000

0.0000

 

0.00000.00000.00000.00000.00000.0000

Columns37through42

0.00000.00000.0000

Columns43through48

0.00000.00000.0000

Columns49through54

0.00000.00000.0000

Columns55through60

0.00000.00000.0000

Columns61through66

0.00000.00000.0000

Columns67through72

0.0000

0.0000

0.0000

0.0000

0.0000

0.0000

0.0000

0.0000

0.0000

0.0000

0.0000

0.0000

0.0000

0.0000

0.0000

0,00000.00000.0000

0,0000

0,0000

0.0000

Columns73through78

0.00000.00000.0001

0.0001

0.0002

0.0002

Columns79through84

0.00040.00050.0003

0.0012

0.0018

0.0026

Columns85through90

0,00390.00530.0087

0.0130

0,0194

0.0289

Columns91through96

0.04310.06430.0959

0.1431

0.2135

0.3186

Columns97through101

0,4752070901.0577

1.5778

2.3539

123

11•矩阵a=456,使用数组信息获取函数求其

789

行列数、元素个数,是否为稀疏矩阵、是否为字符型。

»a=reshape(1:

9,3,3);a=a'%buwl

a=

123

456

789

»issparse(a)%bywl

»size(a)%bywl

ans=

ans=

33

0

>>numel(a)%bywl

»ischar(a)%bywl

ans=

ans=

9

0

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

当前位置:首页 > 工作范文 > 行政公文

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

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