How to extend this code?
조회 수: 2 (최근 30일)
이전 댓글 표시
I have attached a code below, which performs an operation. In the code below, i have done it with input as 8 digits. i want it with 128 digits. How can i use for loops and solve this issue?? for eg: here
x='11101101'
v='11001011'
Z='00000000'
But i want it for x=d9313225f88406e5a559......0000000 (128 digits each) {hexa decimal values}
x = '11101101';
v = '11001011';
Z = '00000000';
R = '10110111';
lsb=v(end);
w=xor(x-'0',v-'0');
movex = @(z,a) [zeros(1,a) z(1:end-a)];
q=movex(v,1);
if x(1,1)==0
Z1=Z;
else
w=xor(Z-'0',v-'0');
end
if lsb==0
v1 = movex(v,1);
else
%k= xor([q{:}]-'0',[R{:}]-'0');
k1=movex(v,1);
k = xor(k1-'0',R-'0');
end
What changes must I make, to make it easier, liking using loops??
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!