Suppress Escape characters in Matlab

I am writing a module in Matlab to enter the configuration parameters of my experiment into the file "parameters.txt".

Here is the module that does this:

for i=1:size(ParamSheetText,1)
    fprintf(fparam, ParamSheetText{i,1});
    fprintf(fparam,'\n');
end

One of the options is the location of the folder: "D: \ temp". fprintfinterprets \tas an escape sequence. Is there a way that I can suppress the escape sequence or change the code so that the escape sequence is suppressed.

thank

+5
source share
1 answer

fprintf parses escape sequences only in format strings, so you should not pass your data string as a format string (but rather as an additional argument following the format specifier):

fprintf(fparam, '%s', ParamSheetText{i,1});

I believe this will fix your problem.

+8
source

All Articles