필터 지우기
필터 지우기

Error using bitxor Matrix dimensions must agree. key1=bitxor(a,b);and key=imresize(key1,[1 256])

조회 수: 1 (최근 30일)
%key generation
a=uint16(dec2bin(sud1));
b=uint16(dec2bin(sud2,8));
key1=bitxor(a,b);
key=imresize(key1,[1 256])
  댓글 수: 1
Praveen  kumar
Praveen kumar 2016년 3월 11일
편집: Walter Roberson 2016년 3월 12일
key=imresize(key1,[1,1],256)
is showing the warning to terminate the statement to suppress the output wit in the script

댓글을 달려면 로그인하십시오.

채택된 답변

Roger Stafford
Roger Stafford 2016년 3월 11일
편집: Roger Stafford 2016년 3월 11일
As you have written the code, the numbers of elements in 'a' and in 'b' depend on how many bits are required to represent 'sud1' and 'sud2', respectively. It is very easy for these to be different, in which case 'bitxor' would give you an error. You need to use the form 'dec2bin(d,n)' for both quantities in which n is the same in both and large enough to guarantee that there will be exactly n bits in each string. For example, if sud1 = 1234 and sud2 = 12345, then n = 14 would cause both strings to have 14 bits, (even though 'a' would have 3 leading zeros beyond the minimum 11 it needs.)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multicore Processor Targets에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by