用C寫matlab function

在 Matlab 的 Command Window 輸入

        mex -setup


#include
#include"mex.h"

void mexFunction(
    int nlhs, mxArray *plhs[],
    int nrhs, const mxArray *prhs[])
{
    printf("Hello, world.\n");
}

存成 hello.c
在 Command Window 輸入

        mex hello.c
        hello

留言

這個網誌中的熱門文章

網路筆記 File Upload on PHP Server in Android

LA流浪記

杜拜