直接用writematrix函数,解决一切。
先将matlab中的300x300的矩阵另存为:x:\a.txt x -ascii,其中“a.txt x -ascii”为文件名,然后用记事本打开试试。
matlab存二进制文件,txt或者dat这种,需要加个'-ascii'。你可以查一下save命令
clearclcn=5;m=6;test=rand(n,m);% 5行6列% 写入txt文件fid=fopen('test.txt','w');fori=...