matlab每次运行添加环境变量 setenv('MW_MINGW64_LOC','C:\TDM-GCC-64'), 或者直接系统添加。 再 mex -setup ,成功 https://blog.csdn.net/Teeyohuang/article/details/79882197