필터 지우기
필터 지우기

Error in fprint command

조회 수: 1 (최근 30일)
lilly lord
lilly lord 2021년 2월 13일
댓글: Star Strider 2021년 2월 13일
Hi. here is part of my code. i am getting error in f print command. The code and error message is also attached. If any one can figure out the mistake. Thanks in advance
% fid = fopen('Result.txt', 'w');
fid = fopen(['Result/Result',int2str(k),',',int2str(l),',',int2str(m),',',int2str(n),',','.txt'], 'w');
for i=1:256
fprintf(fid,'%d',Trans(i,2)); %%% error is at this line(153)
fprintf(fid,',');
end
fclose(fid);
Error
Error using fprintf
Invalid file identifier. Use fopen to generate a valid file identifier.
Error in main_new (line 153)
fprintf(fid,'%d',Trans(i,2));

채택된 답변

Star Strider
Star Strider 2021년 2월 13일
The comma characters may not be permitted in the operating system you are using.
Replacing them with underscores ('_') may be the best option.
  댓글 수: 2
lilly lord
lilly lord 2021년 2월 13일
Thanks.
Star Strider
Star Strider 2021년 2월 13일
As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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