LSB algoritm in matrix

3 次查看(过去 30 天)
I hide bits in some values in matrix according spesific rule
for example,
A = 10;
X = [20 5 3; 50 40 9; 11 42 15];
[x,y] = size (X);
I will hide S = [0,1,0,0,1]; using LSB in values of 'X' that greater than 'A'
[a,b] = size(S);
by function X1(x,y) = bitset(X(x,y), 1, str2num(S(a,b)));
My quesion is how i can extract the hidden bit from new matrix 'X1'?
I used bitget function, but it gave me error values not [0,1,0,0,1]

采纳的回答

Walter Roberson
Walter Roberson 2012-7-8
char( bitget(X1(x,y), 1) + '0' )

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by