A sample of the data would be :
36 00 00 00 73 61 6d 70 6c 65 00
Where the first byte is the length of the string that appears after the three empty(00) bytes.
In a regular hex editor i can read the string as askii, but I have not been able to find a function in Matlab that will allow me to do this. I've tried Text scan, fread and fgetl to no avail.
All i'm trying to do is read in the text with each value on a new line. I know this format is used in a few cases, i am just out of ideas on how to read it into matlab.
Thanks,
Adrian
For your example it might be better to read the first byte, then you know the following size, and read the next bytes.
For converting hex to char: char(hex2num(str)).
---
% reading
fid = fopen(filename,'r');
firstByte = fread(fid,1,'*char');
length = hex2num(str);
data = fread(fid,length,*char);
fclose(fid)
% converting (quick 'n' dirty)
str(length) = ' '; % Prelocate
for k = 1 : length;
string(k) = char(hex2num(data(2*k-1:2*k)) ;
end;
---
I did not test it, just typed it by mind.