a=[2 4 1;4 1 6;7 1 4];
直接运行就可以了:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
>> A=[1,2,3;4,5,6;7,8,9];
>> A1=A(1:2:end)
A1 =
1 7 5 3 9
>> A2=A([1,2,3],[1,1,1])
A2 =
1 1 1
4 4 4
7 7 7
>> A3=A<5
A3 =
1 1 1
1 0 0
0 0 0
>> A4=find(A>5)
A4 =
3
6
8
9
>> [i,j]=find(A>5)
i =
3
3
2
3
j =
1
2
3
3