Continuacion Cambio de bit
Publicado por Marco Antonio (61 intervenciones) el 09/10/2017 19:33:05
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
33
x13 =
1.0e+12 *
2.351834201351000
2.352214734420000
0.300760467282000
0.300698386970000
0.300698386969860
0.996772019463192
0.428002489561000
0.542637058001000
3.953578773831000
3.953578773848000
u=dec2bin(x13);
for i=1:size(x13,1)
A{i}=u(i,:);
end
P3=[];
for i=1:length(A)
P3=[P3,A{i}];
end
P3
for i=1:length(P3)
b=str2double(P3(i));
r=rand;
if r<0.05;
P3(i)=num2str(~b);
end
end
P3mutada=P3
ahora nesecito saber cuales bit fueron cambiados
gracias de ante mano
Valora esta pregunta
-1