problem with loading .dat file
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Olga
el 5 de Feb. de 2012
I've got a .dat file which I load into my program by such a formula:
fread(FID, 4, 'uint8');
Data = fread(FID, [1, 4092], 'uint8');
Calib = Data(4:4:end); % Pierwsza czesc pliku - kalibracja
fread(FID, 4, 'uint8');
Data = fread(FID, [4096, 204600], 'uint8');
x1 = Data(1:2:204600);
The problem is that after 4092 bytes there're 16 bytes that I need to skip and continue loading the following data. A this happens every 4092 bytes. Is there any way to solve this problem? Will be grateful for any help.
0 comentarios
Respuesta aceptada
Walter Roberson
el 5 de Feb. de 2012
'4092*uint8', 16
3 comentarios
Walter Roberson
el 6 de Feb. de 2012
Hmmmm, that is not what "help fread" says should happen. The help information says specifically that the skip will be re-used. Which MATLAB version are you using? I am looking at the information for 2008b and for 2011b.
Side issue: do you perhaps want to be using 'uint8=>uint8' ? Your current code reads uint8 and converts them to double. To keep as uint8 with the skip,
'4092*uint8=>uint8', 16
Más respuestas (0)
Ver también
Categorías
Más información sobre Import, Export, and Conversion en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!