MATLAB: Just a command about fprint doit4mefprintfhomeworkscript how can I use fprint? Best Answer I suggest you try and practice instead of going to forums directly. Play around with this code a bit and get familiar with it and really try to understand how and why it works.ang = pi*rand(1,20);A = 1; B = 1; % Choose A and By = A.*cos(ang)./(B.*sin(ang));z = [ang; y];fid = fopen('yournamesurname.txt', 'wt');fprintf(fid, '%f\t\t%f\n', z);fclose(fid); Related SolutionsMATLAB: New line You might try using 'at' instead of 'a' when you fopen(). MATLAB: Slash / after text .txt Just print it before closing the file.% open your file for writingfid = fopen('test.txt','wt');fprintf(fid,'super\n');% write the matrixmyData = randi(255,10,3); if fid > 0 fprintf(fid,'%d %d %d\n',myData'); endfprintf(fid,'/');fclose(fid); Related QuestionError Inner Matrix Dimensions must agree?? Help!How to write a circulation when save selected data into new matrix and then save new matrix into a text fileSSS Triangle functions, need output help
Best Answer