MATLAB: How to put a vector in a file filetext filetxtvector I'd like to create a vector from 1 to 744 (vertically) and put that in a file .txt 123....744 Thanks Best Answer [fid,msg] = fopen('filename.txt','wt');assert(fid>=3,msg)fprintf(fid,'%d\n',1:744)fclose(fid);OrV = 1:744;dlmwrite('filename.txt',V(:),'newline','pc') Related SolutionsMATLAB: How to read a textfile without header and commas rawdata = fscanf(fid, ',,,%f,%f', [2 inf]) .'; MATLAB: How to save the outputted string (retaining tabs/added lines) to a .txt file [fid,msg] = fopen('yourfile.txt','wt');assert(fid>=3,msg)fprintf(fid,'%s',MESSAGE);fclose(fid); Related QuestionText file help.How to write matrix to txt or excel file with specific precisionHow to append a text file to another text file
Best Answer