MATLAB: How to print \ in fprintf

MATLAB

I have to print a command to a file,
lib_def = '.lib C:\Users\vaidy\Documents\LTspiceXVII\lib\cmp\standard.mos\n'
Opamp_lib = '.lib UniversalOpamps2.sub\n'
File = fopen('oscillator_8.cir','w');
fprintf(File,sprintf(lib_def));
fprintf(File,Opamp_lib);
fclose(File);
I'm using the above commands, but it doesn't print the same to the file.
Output:
.lib C:.lib UniversalOpamps2.sub

Best Answer

lib_def = '.lib C:\Users\vaidy\Documents\LTspiceXVII\lib\cmp\standard.mos' %no \n here!
fprintf(File,'%s\n', lib_def);