Sai
unread,May 16, 2013, 7:20:09 AM5/16/13You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hi,
I doing a project where i need to mask ie is bitwise and of two hexadecimal numbers
eg: 401 and 402
I am kind of new to matlab and doing a very tedious way i am currently doing is:
A1 = 401; % int32, in the acutal part of my code, this A value will be int32
A2 = 402;
A1 = double(A1) % Coverting it to double
A2 = double(A2)
B1 = num2str(A1)
B2 = num2str(A2)
C1 = hex2num(B1)
C2 = hex2num(B1)
q = quantizer('double')
D1 = num2bin(q,C1) % Binary value
D2 = num2bin(q,C2) % Binary value
%E = bitand(401, 402) %% CANNOT DO BIT_WISE "AND" operation unless both input arguments are of same type ie...integer
all i want the ans to be is
1. I know that 401 is an hexadecimal number, how do i represent this 401 itself as in hexadecimal number?
- any help in this is greatly appreciated, cos most of my problem will be solved!!
or
2. convert the value of the D1 and D2 char string to a matrix like this
eg:
401 = '010000000001' as [0 1 0 0 0 0 0 0 0 0 0 1]
402 = '010000000001' as [0 1 0 0 0 0 0 0 0 0 1 0]
then in can carry on with the tedious process to continue with the bitwise and operation.
Any help is greatly appreciated or any suggestion also solves my problem, pls do so!