M1=[2;3;7];
M2=[8;6;9;3];
M3=[4;9;6;12;18];
unir=[M2;M3]
Med=mean(unir)
clear
M1=[2;3;7]
M2=[8;6;9;3]
M3=[4;9;6;12;18]
M4=[4;9;6;12;18;20]
a=whos('M*');
for i=1:4
for j=i:4
if i~=j
unir=[eval(a(i).name);eval(a(j).name)]
Med=mean(unir)
end
end
end
% 1 2
% 1 3
% 1 4
% 2 3
% 2 4
% 3 4
>> practica_2020
M1 =
2
3
7
M2 =
8
6
9
3
M3 =
4
9
6
12
18
M4 =
4
9
6
12
18
20
unir =
2
3
7
8
6
9
3
Med =
5.4286
unir =
2
3
7
4
9
6
12
18
Med =
7.6250
unir =
2
3
7
4
9
6
12
18
20
Med =
9
unir =
8
6
9
3
4
9
6
12
18
Med =
8.3333
unir =
8
6
9
3
4
9
6
12
18
20
Med =
9.5000
unir =
4
9
6
12
18
4
9
6
12
18
20
Med =
10.7273