>> a=magic(3)
a =
8 1 6
3 5 7
4 9 2
>> a
a =
8 1 6 5
3 5 7 0
4 9 2 0
>> b=rand(3,4)
A=[a,b]
b =
0.8147 0.9134 0.2785 0.9649
0.9058 0.6324 0.5469 0.1576
0.1270 0.0975 0.9575 0.9706
A =
8.0000 1.0000 6.0000 5.0000 0.8147 0.9134 0.2785 0.9649
3.0000 5.0000 7.0000 0 0.9058 0.6324 0.5469 0.1576
4.0000 9.0000 2.0000 0 0.1270 0.0975 0.9575 0.9706
>> B=A(:,[2,3])
B =
1 6
5 7
9 2
>> c=A'
c =
8.0000 3.0000 4.0000
1.0000 5.0000 9.0000
6.0000 7.0000 2.0000
5.0000 0 0
0.8147 0.9058 0.1270
0.9134 0.6324 0.0975
0.2785 0.5469 0.9575
0.9649 0.1576 0.9706
>> d=eye(4)
D=triu(d)
d =
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
D =
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
>> E=rand(4,5)
l1=find(D(1,:)>0.3)
l2=find(D(2,:)>0.3)
e=[E(1,l1),E(2,l2)]
E =
0.9572 0.4218 0.6557 0.6787 0.6555
0.4854 0.9157 0.0357 0.7577 0.1712
0.8003 0.7922 0.8491 0.7431 0.7060
0.1419 0.9595 0.9340 0.3922 0.0318
l1 =
1
l2 =
2
e =
0.9572 0.9157
>>
a =
8 1 6
3 5 7
4 9 2
>> a
a =
8 1 6 5
3 5 7 0
4 9 2 0
>> b=rand(3,4)
A=[a,b]
b =
0.8147 0.9134 0.2785 0.9649
0.9058 0.6324 0.5469 0.1576
0.1270 0.0975 0.9575 0.9706
A =
8.0000 1.0000 6.0000 5.0000 0.8147 0.9134 0.2785 0.9649
3.0000 5.0000 7.0000 0 0.9058 0.6324 0.5469 0.1576
4.0000 9.0000 2.0000 0 0.1270 0.0975 0.9575 0.9706
>> B=A(:,[2,3])
B =
1 6
5 7
9 2
>> c=A'
c =
8.0000 3.0000 4.0000
1.0000 5.0000 9.0000
6.0000 7.0000 2.0000
5.0000 0 0
0.8147 0.9058 0.1270
0.9134 0.6324 0.0975
0.2785 0.5469 0.9575
0.9649 0.1576 0.9706
>> d=eye(4)
D=triu(d)
d =
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
D =
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
>> E=rand(4,5)
l1=find(D(1,:)>0.3)
l2=find(D(2,:)>0.3)
e=[E(1,l1),E(2,l2)]
E =
0.9572 0.4218 0.6557 0.6787 0.6555
0.4854 0.9157 0.0357 0.7577 0.1712
0.8003 0.7922 0.8491 0.7431 0.7060
0.1419 0.9595 0.9340 0.3922 0.0318
l1 =
1
l2 =
2
e =
0.9572 0.9157
>>