LSB algoritm in matrix

3 views (last 30 days)
Aseel H
Aseel H on 8 Jul 2012
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]

Accepted Answer

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

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!