请高手们指点啊!

解决方案 »

  1.   

    我的信箱是[email protected],原来这里有个matlabword的站点被盗链接了,看不了里面的文章,请前辈们指点我一下,多谢了啊!
      

  2.   

    #include <engine.h> 
         
        void main() 
        { 
         Engine* ep=0; 
         ep=engOpen(NULL); //打开matlab      
         
         engEvalString(ep,"test"); //test是自己编辑的一个指令 
        } 
      

  3.   

    实现外部调用的思路是:首先将m文件加入到一段C程序中,然后通过MATLAB中的mex批处理文件将该C文件生成exe文件,然后通过VC++的外部调用的函数shellexec()或winexec()实现调用。 
      mex批处理文件的调用格式如下:     mex  -f  msvc60engmatopts.bat  *.c
        c文件的格式如下:
     /* engwindemo.c
     * This is a simple program that illustrates how to 
         call the MATLAB
     * Engine functions from a C program for windows */
    #include <windows.h>
    #include <stdlib.h>
    #include <stdio.h>
    #include <string.h>
    #include <d:\matlab\extern\include\engine.h>
    void main()
    {
    Engine *ep;
    /*
     * Start the MATLAB engine 
    */
    if (!(ep = engOpen(NULL))) {
    MessageBox ((HWND)NULL, (LPSTR)
    “Can't start MATLAB engine", , MB_OK);
    exit(-1);
    }
    engEvalString(ep, “contour(peaks)");
    engClose(ep);
    }