Extract float data from a binary file

Dear Expert,
I Want to read a binary file consist of float and char format as following:
struct PP
{
char name[9];
float x,y,z,m,n,p,q,r;
};
How can I extract only float data from the binary file with fread .

 Risposta accettata

KSSV
KSSV il 30 Apr 2019
fid = fopen(myfile,'r') ;
str = fread(fid,9,'*char')' ;
num = fread(fid,9,'*float') ;
fclose(fid) ;

Più risposte (0)

Richiesto:

il 29 Apr 2019

Risposto:

il 30 Apr 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by