matlab实验习题3.docx

上传人:b****7 文档编号:24041357 上传时间:2023-05-23 格式:DOCX 页数:13 大小:16.39KB
下载 相关 举报
matlab实验习题3.docx_第1页
第1页 / 共13页
matlab实验习题3.docx_第2页
第2页 / 共13页
matlab实验习题3.docx_第3页
第3页 / 共13页
matlab实验习题3.docx_第4页
第4页 / 共13页
matlab实验习题3.docx_第5页
第5页 / 共13页
点击查看更多>>
下载资源
资源描述

matlab实验习题3.docx

《matlab实验习题3.docx》由会员分享,可在线阅读,更多相关《matlab实验习题3.docx(13页珍藏版)》请在冰豆网上搜索。

matlab实验习题3.docx

matlab实验习题3

●Matlab实验报告

姓名:

窦慧敏

学号:

JV144036

2.4

>>A=[11121314;21222324;31323334;41424344]

A=

11121314

21222324

31323334

41424344

>>A(:

1)

ans=

11

21

31

41

>>A(2,:

ans=

21222324

>>A(:

2:

3)

ans=

1213

2223

3233

4243

>>A(2:

3,2:

3)

ans=

2223

3233

>>A(:

1:

2:

3)

ans=

1113

2123

3133

4143

>>A(2:

3)

ans=

2131

>>A(:

ans=

11

21

31

41

12

22

32

42

13

23

33

43

14

24

34

44

>>A(:

:

ans=

11121314

21222324

31323334

41424344

>>ones(2,2)

ans=

11

11

>>eye

(2)

ans=

10

01

>>[A,[ones(2,2);eye

(2)]]

ans=

1112131411

2122232411

3132333410

4142434401

>>diag(A)

ans=

11

22

33

44

>>diag(A,1)

ans=

12

23

34

>>diag(A,-1)

ans=

21

32

43

>>diag(A,2)

ans=

13

24

2.6

>>x=[4+8i3+5i2-7i1+4i7-5i;3+2i7-6i9+4i3-9i4+4i]

x=

Columns1through2

4.0000+8.0000i3.0000+5.0000i

3.0000+2.0000i7.0000-6.0000i

Columns3through4

2.0000-7.0000i1.0000+4.0000i

9.0000+4.0000i3.0000-9.0000i

Column5

7.0000-5.0000i

4.0000+4.0000i

>>x'

ans=

4.0000-8.0000i3.0000-2.0000i

3.0000-5.0000i7.0000+6.0000i

2.0000+7.0000i9.0000-4.0000i

1.0000-4.0000i3.0000+9.0000i

7.0000+5.0000i4.0000-4.0000i

2.9

>>A=[492;764;357]

A=

492

764

357

>>B=[37;26;28]

B=

37

26

28

>>A\B

ans=

-0.5118

4.0427

1.3318

>>

2.10

>>a=[123;456;789]

a=

123

456

789

>>a*a

ans=

303642

668196

102126150

>>a.*a

ans=

149

162536

496481

2.11

>>A=[276;90-10;30.56]

A=

2.00007.00006.0000

9.00000-10.0000

3.00000.50006.0000

>>B=[20.20;325;40.57]

B=

2.00000.20000

3.00002.00005.0000

4.00000.50007.0000

>>A|B

ans=

111

111

111

>>A&B

ans=

110

101

111

>>A~B

?

?

?

A~B

|

Error:

UnexpectedMATLABoperator.

>>A>B

ans=

011

100

000

>>A>=B

ans=

111

100

010

>>A

ans=

000

011

101

>>A<=B

ans=

100

011

111

>>A==B

ans=

100

000

010

>>A~=B

ans=

011

111

101

>>A(5)

ans=

0

>>B(3)

ans=

4

>>B(7)

ans=

0

>>A()>6

ans=

010

100

000

>>B()>6

ans=

000

000

001

2.12

2.15

>>b=cell

(2)

b=

[][]

[][]

>>b(1,1)={'北京'}

b=

'北京'[]

[][]

>>b{1,2}='上海'

b=

'北京''上海'

[][]

>>b(2,1)={'5'}

b=

'北京''上海'

'5'[]

>>b(2,1)={5}

b=

'北京''上海'

[5][]

>>b{2,2}=[59;62]

b=

'北京''上海'

[5][2x2double]

2.16

>>a=[42;75]

a=

42

75

>>b=[71;83]

b=

71

83

>>c=[59;62]

c=

59

62

>>d=cat(1,a,b,c)

d=

42

75

71

83

59

62

>>d=cat(1,a,b)

d=

42

75

71

83

>>d=[a(:

);b(:

);c(:

)]

d=

4

7

2

5

7

8

1

3

5

6

9

2

>>d=[a(:

);b(:

);c(:

)]

d=

4

7

2

5

7

8

1

3

5

6

9

2

>>d=reshape(d,4,3)

d=

475

786

219

532

>>d=[a(:

);b(:

);c(:

)]

d=

4

7

2

5

7

8

1

3

5

6

9

2

>>d.'

ans=

Columns1through11

47257813569

Column12

2

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

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

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1