understanding fscanf reshape combination in reading a file

2 visualizaciones (últimos 30 días)
fima v
fima v el 16 de Jul. de 2022
Respondida: Image Analyst el 16 de Jul. de 2022
Hello, i have the following attached file where i have 3 subtables.
after running the code bellow ,i am trying to understand the following
1.why did it stop scanning on the end of the first subtable?
2.after the scaning my data in variable S looks as following , how reshape(s,2,[]) knows to make first row and the even members and second row as odd members of variable 's'?
Thanks.
fid=fopen('file.txt');
data={};
fgetl(fid);
fgetl(fid);
s=fscanf(fid,'%f');

Respuestas (1)

Image Analyst
Image Analyst el 16 de Jul. de 2022
Why not simply use readmatrix? Be sure to specify the number of header lines.

Categorías

Más información sobre Structures en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by