下载matlab支持的mingw版本,不支持感觉也就是出个警告,问题不大,注意需要下载x86_64的版本,否则matlab不识别,下载路径如下:
https://sourceforge.net/projects/mingw-w64/files/
解压后放置到一个路径如D:\MINGW,后面的环境变量配置要用到这个位置
配置环境变量:
在我的电脑上点右键-》属性-》高级系统设置-》

在path变量中加入一项,注意这里要根据自己实际放置的位置来
D:\MinGW\bin
测试一下:

在matlab中输入:
系统检测到不同的编译器后,会提示如何将某个编译器配置为mex编译器,按照提示命令执行即可。
测试matlab自带示例程序:
/*=================================================================
* mexfunction.c
*
* This example demonstrates how to use mexFunction. It returns
* the number of elements for each input argument, providing the
* function is called with the same number of output arguments
* as input arguments.
* This is a MEX-file for MATLAB.
* Copyright 1984-2018 The MathWorks, Inc.
* All rights reserved.
*=================================================================*/
#include "mex.h"
void mexFunction(int nlhs
配置MATLAB与mingw兼容:解决MEX函数编译警告

最低0.47元/天 解锁文章
548

被折叠的 条评论
为什么被折叠?



