a=magic(5)
a =
17 24 1 8 15
23 5 7 14 16
4 6 13 20 22
10 12 19 21 3
11 18 25 2 9
>> b=[a(1:3,1:3)]
b =
17 24 1
23 5 7
4 6 13
>> c=[a(1:3,4:5)]
c =
8 15
14 16
20 22
这样就可以分成几个小矩阵啦
专门的语句,来分,貌似没有,只能取元素
a(i,j)取对应的元素而已,也可以多个
a=magic(5)
a =
17 24 1 8 15
23 5 7 14 16
4 6 13 20 22
10 12 19 21 3
11 18 25 2 9
>> b=[a(1:3,1:3)]
b =
17 24 1
23 5 7
4 6 13
>> c=[a(1:3,4:5)]
c =
8 15
14 16
20 22
这样就可以分成几个小矩阵啦
专门的语句,来分,貌似没有,只能取元素
a(i,j)取对应的元素而已,也可以多个