Use writematrix() in R2019a and later
writematrix(M, 'filename.txt') % M is matrix name
for older versions, you can use dlmwrite()
dlmwrite('filename.txt', M)
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!