필터 지우기
필터 지우기

understanding fscanf reshape combination in reading a file

조회 수: 2 (최근 30일)
fima v
fima v 2022년 7월 16일
답변: Image Analyst 2022년 7월 16일
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');

답변 (1개)

Image Analyst
Image Analyst 2022년 7월 16일
Why not simply use readmatrix? Be sure to specify the number of header lines.

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by