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 .

 Akzeptierte Antwort

KSSV
KSSV am 30 Apr. 2019

0 Stimmen

fid = fopen(myfile,'r') ;
str = fread(fid,9,'*char')' ;
num = fread(fid,9,'*float') ;
fclose(fid) ;

Weitere Antworten (0)

Gefragt:

am 29 Apr. 2019

Beantwortet:

am 30 Apr. 2019

Community Treasure Hunt

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

Start Hunting!

Translated by