필터 지우기
필터 지우기

what should I change in the script for solving "Error in using fscanf". Thank you

조회 수: 2 (최근 30일)
Amra Rajuli
Amra Rajuli 2018년 1월 29일
댓글: Jan 2018년 1월 29일
what should I change in the script for solving "Error in using fscanf". Thank you
_ *Error using fscanf Invalid file identifier. Use fopen to generate a valid file identifier.
Error in data_proc_auto (line 274) a = fscanf(fid,'%g',inf); % write all data into a column of matrix a*_

답변 (1개)

Jan
Jan 2018년 1월 29일
In your script, the line 274: a = fscanf(fid,'%g',inf); fails, because the file identifier replied by the line before: fid = fopen(deformname) is invalid. This happens, because there is no existing file for the name stored in deformname.
Prefer to check the success of opening files:
[fid, msg] = fopen(deformname);
if fid == -1
error(msg);
end
You can solve the problem by providing the name of an existing file. Include the full path, because this is safer.

카테고리

Help CenterFile Exchange에서 Low-Level File I/O에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by