Prev: Nan and Inf in princomp
Next: NchooseK
From: Bogdan Markovic on 9 Mar 2010 18:04 i have to solve this problem: how can i read *.txt file in matlab,and covert it to hex? Every 4 bits must be in one cell.i hope that you understand me.thank you.
From: Walter Roberson on 9 Mar 2010 18:36 Bogdan Markovic wrote: > i have to solve this problem: > how can i read *.txt file in matlab,and covert it to hex? Every 4 bits > must be in one cell.i hope that you understand me.thank you. fread() the file with PRECISION 'bit4=>uint8'. The result will be an unsigned numeric array. If you need to convert the unsigned numeric array to the traditional equivalent characters, index ['0':'9','A':'F'] by the (the numeric array + 1). The +1 compensates for the fact that Matlab indexing starts at 1, not a 0.
|
Pages: 1 Prev: Nan and Inf in princomp Next: NchooseK |