Tags: binary, coded, dataset, dec2bin, decode, efficient, function, hex2bin, hex2dec, hexadecimal, huge, matlab, programming, translate
efficient hex2bin function
I have a huge dataset that is coded in hexadecimal. I need to translate it i
nto binary to decode it. I have been using dec2bin(hex2dec(dataset)) which t
akes a long time for my data (~15 minutes). An example dataset is:
So my question is: does anyone have an efficient way to do the conversion? A
direct hex2bin function would be nice, I just haven't been able to figure o
ut how to vectorize the character substitutions (i.e. a 3 in hex becomes a 0
011 in binary).
Thanks for any ideas.
Leave a comment...
- 4 Comments
here is a reply by <us> in a previous thread :
Jeff Tackett, "hex2bin function" #, 5 Oct 2004 6:03 pm </WebX?50.matlab.todaysummary.com..matlab.todaysummary.com..eeec1f6>
Jrpme#1; Wed, 30 Apr 2008 19:15:00 GMT
- I think my post made it clear that I was trying to go beyond the solutions p
resented in the previous thread. If after re-reading my post you have any id
eas, I'd be grateful. Thanks.
Andy#2; Wed, 30 Apr 2008 19:16:00 GMT
- Andy wrote:
> I think my post made it clear that I was trying to go beyond the
> solutions presented in the previous thread. If after re-reading my
> post you have any ideas, I'd be grateful. Thanks.
You could always turn your entire HEX stream into a binary stream
using lookup tables. And then reshape to whatever word length you
0110100000110010#3; Wed, 30 Apr 2008 19:17:00 GMT
- Steve Amphlett wrote:
<snip, posted with errors before checking...
I meant to post this:
0011001101110110#4; Wed, 30 Apr 2008 19:18:00 GMT