本文共 285 字,大约阅读时间需要 1 分钟。
1. 新建一个hello.c的文件
//hello.c#include "mex.h"void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]){ mexPrintf("Hello, world!\n"); return;}2.打开matlab, 转到hello.c文件所在的目录, 然后在命令行输入
mex hello.c
然后我们就可以看到我的目录下面多了一个以mexw64结尾的文件,该文件名就是可供我们使用的命令
3. 在命令行里输入
hello结果如下: