在 python 上获取 matlab 代码的结果



我在 matlab 中有代码,我想在 python 代码中使用其结果(作为矩阵或.dat文件)。谁能告诉我这是怎么做到的?

NumPy和SciPy可以直接使用scipy.io.loadmatscipy.io.savemat读写MATLAB .mat文件。

.dat文件只是一个文本文件:

fid = fopen('outputFile.dat', 'wt');
fprintf(fid, your_data_in_string_format);
fclose(fid);

最新更新