Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clc
- x = [ 1 1 1 1 1];
- s=50;
- for n = 1:s
- A = x(1,3);
- B = x(1,5) ;
- xor(A,B);
- C=xor(A,B);
- output = x(1,5);
- x(1,5)=x(1,4);
- x(1,4)=x(1,3);
- x(1,3)=x(1,2);
- x(1,2)=x(1,1);
- x(1,1)=C;
- fprintf('第%d個output為%d\n',n,output);
- x
- end
- x = [ 1 1 1 1 1];
- for n = 1:s
- A = x(1,3);
- B = x(1,5) ;
- xor(A,B);
- C=xor(A,B);
- output = x(1,5);
- x(1,5)=x(1,4);
- x(1,4)=x(1,3);
- x(1,3)=x(1,2);
- x(1,2)=x(1,1);
- x(1,1)=C;
- if (n<=19) & (n>=10)
- fprintf('第%d個output為%d\n',n,output);
- end
- if(n==40)
- fprintf('\n');
- end
- if (n<=50) & (n>=41)
- fprintf('第%d個output為%d\n',n,output);
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement