How to work on fprintf in fopen?

조회 수: 1 (최근 30일)
Radhika
Radhika 2013년 12월 23일
댓글: Wayne King 2013년 12월 23일
Hi team,
I am using following code
[ftxt,msg] = fopen([textpath keyword '_summary.txt' ],'w');
fprintf(ftxt, 'Summary sheet of %12s\n\n', TR);
and i am getting error as
Error using fprintf
Invalid file identifier. Use fopen to generate a valid file identifier.
Please help me solving this problem.

답변 (1개)

Wayne King
Wayne King 2013년 12월 23일
What is msg? That is the system-dependent error message returned by fopen. I'm assuming the value of txt is -1 meaning the fopen() operation did not work.
  댓글 수: 2
Radhika
Radhika 2013년 12월 23일
Why is it not working?
Wayne King
Wayne King 2013년 12월 23일
I'm afraid you need to provide us with more information than you have given. Are we supposed to know what textpath is or keyword?

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

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by