Read data from binary file
Mostrar comentarios más antiguos
Hi all.
I am having trouble with reading a dataset in binary format. I have tried with the 'fread' and 'fopen' function, but can't seem to get what I want.
The binary file should be a dataset for some wind velocity. When using the 'fread' and 'fopen' I just get a lot of integers, that doesn't look like the typical development in wind velocity fluctuations:
%%%
data1 = fread(fopen('data.bin','r'));
plot(data1(1:1000))
%%%
I also tried to separate the data into more columns, which also don't look like the solution to my problem:
%%%
noc = 8; %Number of columns
data = reshape(data1,noc,length(data1)/noc)';
for i = 1:noc
subplot(noc,1,i),plot((0:1:length(data)-1),data(:,i)),xlim([0,1000])
end
%%%
Do I need to convert this to something else, or can anyone give me a hint in the right direction? It might be my lack of knowledge for binary files.
Best regards
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Aerospace Blockset en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!