I am writing a module in Matlab to enter the configuration parameters of my experiment to a file 'parameters.txt'.
Here is the module which does that :
for i=1:size(ParamSheetText,1)
fprintf(fparam, ParamSheetText{i,1});
fprintf(fparam,'\n');
end
One of the parameter is the folder location : "D:\temp". fprintf
is interpreting \t
as a escape sequence. Is there any way that I can suppress the escape sequence or modify the code so that escape sequence is suppressed.
Thanks
fprintf
is parsing escape sequences only in format strings, so you shouldn't be passing 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 correct your issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With