MATLAB: Doubt in fprintf with double bar fprintfMATLAB How can I print something like this: fprintf(fileID,'>|/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|< \r\n'); or like fprintf(fileID,'\\'); I get: Control Character '\/' is not valid. Thanks Best Answer str = '>|/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|<';fprintf(fileID, '%s\r\n', str);fprintf(fileID, '\\\\') Related SolutionsMATLAB: When i run the program of data writting to a file i have got exponential data.how it will be in the decimel format fprintf(fileID,'%f',data(x,y,z)) MATLAB: Infinite loop problem making text file Why you are opening a file inside the loop? It should be outside the loop. Try this:%Creating the datafile% Datafile OperationsfileID = fopen('DSP_HW4.txt', 'wt');for i = 1:16 Q = [(i);t(i);g(i)]; fprintf(fileID, '%2s', 'n'); fprintf(fileID, '%6s', 'Time'); fprintf(fileID, '%6s', 'g(n)'); fprintf(fileID, '\n'); fprintf(fileID,'%2.0f %+8.3f %+8.3\n', Q);endtype('DSP_HW4.txt');fclose(fileID); Related QuestionWriting parameters to a text fileHow to store a data of a structure into a text file.How to print some text in a txt file in another folderHow to write low level text to a file without interpretationPrint OCR results to text fileProblem using fprintf for writing celldata into world.
Best Answer