function back = Mat2txt( file_Name, matrix )
fop = fopen( file_Name, 'wt' );
[M,N] = size(matrix);
for m = 1:M
for n = 1:N
fprintf( fop, ' %s', mat2str( matrix(m,n) ) );
end
%fprintf(fop, '\n' );
end
back = fclose( fop ) ;
具体用法:Mat2txt('coord.txt',coord)
注:coord.txt为要保存到的txt文件
coord为matlab中的.mat矩阵文件
参考:
https://blog.csdn.net/sinat_20177327/article/details/77369618?locationNum=2&fps=1