MATLAB: How to obtain a .csv file csvMATLABmatrix I have written and ran a code,I got the output as a matrix.Now to use the matrix in a software, I need to generate a .csv file of the matrix.What should be done? Best Answer https://www.mathworks.com/help/matlab/ref/writematrix.htmlDocumentation for writematrix function, writematrix(A,filename) here A is the matrix and filename is the name of the .csv file you want to save it to.https://www.mathworks.com/help/matlab/ref/csvwrite.htmlThis is another possible function, but it is not recommended by matlab. Related SolutionsMATLAB: Upload txt file for a matrix check out dlmread()https://www.mathworks.com/help/matlab/ref/dlmread.htmlor textscan()https://www.mathworks.com/help/matlab/ref/textscan.html MATLAB: Saving data in .dat files There is no specific format for a .dat file. You can use writematrix(): https://www.mathworks.com/help/releases/R2020a/matlab/ref/writematrix.html or dlmwrite(): https://www.mathworks.com/help/releases/R2020a/matlab/ref/dlmwrite.html in older versions.For example,writematrix(sr, 'filename.dat') % or dlmwrite('filename.dat', sr); Related QuestionCannot read .csvHow to read and work with a csv file (.csv)Converting matlab to .csv file
Best Answer