给你写个简单例子你可以参考一下,将1,2,3写入in.txt文件中,具体函数使用可以参考matlab的help文档,注意路径要找对fopen('in.txt','wb');fid=fopen('in.txt','wb');fwrite(fid,'1,2,3');