fprintf error inside function?

조회 수: 3 (최근 30일)
David Rising
David Rising 2015년 3월 31일
댓글: David Rising 2015년 3월 31일
I am trying to create a log file as a txt from a program I am building. The problem is that I keep getting the "Undefined function 'fprinf' for input arguments of type 'double'." error when I try to write to it using fprintf. A sample code is shown:
fid=fopen(path,'w'); fprinf(fid,'%s \r\n',log); fclose(fid);
where path is a local string on my Computer and "log" is a character Array.
I can open the file just file, it creates the .txt file (I can see it in Windows) and a fid interger is given. But the fprtinf line gives the error mentioned above. I can enter it once into the Command Window and the "Did you mean:" Comes up and Displays the exact same command. I enter it again and it works but then it never works in my function. Am I missing something easy here?
Thanks! Dave

채택된 답변

Sean de Wolski
Sean de Wolski 2015년 3월 31일
편집: Sean de Wolski 2015년 3월 31일
fprintf not fprinf :)
  댓글 수: 1
David Rising
David Rising 2015년 3월 31일
Face meet Palm. I have been working too long working on this project...

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by