MATLAB: How to print the code for an html link to a file

codefprintfprintfhtmllinklinksprint

I'm trying to write html code to a file, such that
<a href="C:\\Users\\trevor.fields\\Desktop\\HTML\\index.html">Main Page</a>
appears in the file. So far I just get a link in the command window and <a href="C in the text file. I'm using
fprintf(fileid, '<a href="C:\\Users\\trevor.fields\\Desktop\\HTML\\index.html">Main Page</a>')

Best Answer

It interpreted \\U as an exit command, \\t as a tab, and so on. Changing each \\ in the address to / fixed the problem.