Tuesday, 6 August 2013

Formatting code "%s\n" is being read by MATLAB as a comment

Formatting code "%s\n" is being read by MATLAB as a comment

I want to write a string to a file and I'm using this code:
fprintf(fileID, %s\n, stringToWrite);
The problem is that from the '%' sign onward the line is being read as a
comment, because '%' is the sign you use to start a comment in MATLAB.
Any idea on what I should do to fix this?

No comments:

Post a Comment