string equivalent of fread
Show older comments
Hi -
I can use
rawData = fread(fid,[59 59])
to read 59 bytes from a binary file, 59 times, convert to decimal, and put results into a 59 X 59 array.
I want to do the same, but read each hex byte literally into a string, i.e. 01 FF -> '01' 'FF', keeping the 59 X 59 structure (i.e. - 1st row: 1st 59 bytes in file as strings, keeping leading zeros; 2nd row: next 59 bytes in file as strings, keeping leading zeros; etc...)
The idea is that I want to combine some columns of strings into longer strings, convert to hex, then convert the hex to decimal.
. . ."AB" "01" . . . -> "AB01" -> AB01 -> 43777 (may not need all steps)
. . ."CC" "02" . . . -> "CC02" -> CC02 -> 52226
etc..
unknown number of rows, where "AB" and "CC" are in column 8, and "01" and "02" are in column 9.
Thoughts?
Accepted Answer
More Answers (0)
Categories
Find more on Cell Arrays 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!