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 で Whos についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!