fprintf error inside function?

2 vues (au cours des 30 derniers jours)
David Rising
David Rising le 31 Mar 2015
Commenté : David Rising le 31 Mar 2015
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

Réponse acceptée

Sean de Wolski
Sean de Wolski le 31 Mar 2015
Modifié(e) : Sean de Wolski le 31 Mar 2015
fprintf not fprinf :)
  1 commentaire
David Rising
David Rising le 31 Mar 2015
Face meet Palm. I have been working too long working on this project...

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Standard File Formats dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by